return Self implementation

This commit is contained in:
yggverse 2024-09-26 01:14:33 +03:00
parent bdad712690
commit 003486e3ed
22 changed files with 22 additions and 22 deletions

View File

@ -13,7 +13,7 @@ pub struct Header {
impl Header { impl Header {
// Construct // Construct
pub fn new() -> Header { pub fn new() -> Self {
let tray = Tray::new(); let tray = Tray::new();
let subject = Subject::new(); let subject = Subject::new();

View File

@ -7,7 +7,7 @@ pub struct Description {
impl Description { impl Description {
// Construct // Construct
pub fn new() -> Description { pub fn new() -> Self {
let widget = Label::builder() let widget = Label::builder()
.css_classes(["subtitle"]) .css_classes(["subtitle"])
.single_line_mode(true) .single_line_mode(true)

View File

@ -14,7 +14,7 @@ pub struct Subject {
impl Subject { impl Subject {
// Construct // Construct
pub fn new() -> Subject { pub fn new() -> Self {
let title = Title::new(); let title = Title::new();
let description = Description::new(); let description = Description::new();

View File

@ -8,7 +8,7 @@ pub struct Title {
impl Title { impl Title {
// Construct // Construct
pub fn new() -> Title { pub fn new() -> Self {
let widget = gtk::Label::builder() let widget = gtk::Label::builder()
.css_classes(["title"]) .css_classes(["title"])
.single_line_mode(true) .single_line_mode(true)

View File

@ -5,7 +5,7 @@ pub struct Menu {
} }
impl Menu { impl Menu {
pub fn new() -> Menu { pub fn new() -> Self {
// Init model // Init model
let model_tab = gio::Menu::new(); let model_tab = gio::Menu::new();
model_tab.append(Some("New"), Some("win.tab_append")); model_tab.append(Some("New"), Some("win.tab_append"));

View File

@ -11,7 +11,7 @@ pub struct Tray {
} }
impl Tray { impl Tray {
pub fn new() -> Tray { pub fn new() -> Self {
let menu = Menu::new(); let menu = Menu::new();
let tab = Tab::new(); let tab = Tab::new();

View File

@ -6,7 +6,7 @@ pub struct Tab {
impl Tab { impl Tab {
// Construct // Construct
pub fn new() -> Tab { pub fn new() -> Self {
Self { Self {
widget: Button::builder() widget: Button::builder()
.action_name("win.tab_append") .action_name("win.tab_append")

View File

@ -13,7 +13,7 @@ pub struct Main {
impl Main { impl Main {
// Construct // Construct
pub fn new() -> Main { pub fn new() -> Self {
// Init components // Init components
let tab = Arc::new(Tab::new()); let tab = Arc::new(Tab::new());

View File

@ -6,7 +6,7 @@ pub struct Title {
impl Title { impl Title {
// Construct // Construct
pub fn new() -> Title { pub fn new() -> Self {
Self { Self {
widget: Label::builder() widget: Label::builder()
.label("New page") .label("New page")

View File

@ -6,7 +6,7 @@ pub struct Content {
impl Content { impl Content {
// Construct // Construct
pub fn new() -> Content { pub fn new() -> Self {
Self { Self {
widget: Box::builder().orientation(Orientation::Vertical).build(), widget: Box::builder().orientation(Orientation::Vertical).build(),
} }

View File

@ -6,7 +6,7 @@ pub struct Reader {
impl Reader { impl Reader {
// Construct // Construct
pub fn new() -> Reader { pub fn new() -> Self {
Self { Self {
widget: Label::builder() widget: Label::builder()
.halign(Align::Start) .halign(Align::Start)

View File

@ -6,7 +6,7 @@ pub struct Text {
impl Text { impl Text {
// Construct // Construct
pub fn new() -> Text { pub fn new() -> Self {
Self { Self {
widget: ScrolledWindow::builder().build(), widget: ScrolledWindow::builder().build(),
} }

View File

@ -6,7 +6,7 @@ pub struct Reader {
impl Reader { impl Reader {
// Construct // Construct
pub fn new() -> Reader { pub fn new() -> Self {
Self { Self {
widget: Label::builder() widget: Label::builder()
.halign(Align::Start) .halign(Align::Start)

View File

@ -14,7 +14,7 @@ pub struct Meta {
} }
impl Meta { impl Meta {
pub fn new() -> Meta { pub fn new() -> Self {
Self { Self {
title: GString::new(), title: GString::new(),
description: GString::new(), description: GString::new(),

View File

@ -6,7 +6,7 @@ pub struct Base {
impl Base { impl Base {
// Construct // Construct
pub fn new() -> Base { pub fn new() -> Self {
Self { Self {
widget: Button::builder() widget: Button::builder()
.action_name("win.tab_page_base") .action_name("win.tab_page_base")

View File

@ -6,7 +6,7 @@ pub struct Bookmark {
impl Bookmark { impl Bookmark {
// Construct // Construct
pub fn new() -> Bookmark { pub fn new() -> Self {
Self { Self {
widget: Button::builder() widget: Button::builder()
.action_name("win.tab_page_bookmark") .action_name("win.tab_page_bookmark")

View File

@ -6,7 +6,7 @@ pub struct Back {
impl Back { impl Back {
// Construct // Construct
pub fn new() -> Back { pub fn new() -> Self {
Self { Self {
widget: Button::builder() widget: Button::builder()
.action_name("win.tab_page_history_back") .action_name("win.tab_page_history_back")

View File

@ -6,7 +6,7 @@ pub struct Forward {
impl Forward { impl Forward {
// Construct // Construct
pub fn new() -> Forward { pub fn new() -> Self {
Self { Self {
widget: Button::builder() widget: Button::builder()
.action_name("win.tab_page_history_forward") .action_name("win.tab_page_history_forward")

View File

@ -14,7 +14,7 @@ pub struct History {
impl History { impl History {
// Construct // Construct
pub fn new() -> History { pub fn new() -> Self {
// init components // init components
let back = Back::new(); let back = Back::new();
let forward = Forward::new(); let forward = Forward::new();

View File

@ -24,7 +24,7 @@ pub struct Navigation {
} }
impl Navigation { impl Navigation {
pub fn new() -> Navigation { pub fn new() -> Self {
// Init components // Init components
let base = Base::new(); let base = Base::new();
let history = History::new(); let history = History::new();

View File

@ -6,7 +6,7 @@ pub struct Reload {
impl Reload { impl Reload {
// Construct // Construct
pub fn new() -> Reload { pub fn new() -> Self {
Self { Self {
widget: Button::builder() widget: Button::builder()
.action_name("win.tab_page_reload") .action_name("win.tab_page_reload")

View File

@ -10,7 +10,7 @@ pub struct Request {
impl Request { impl Request {
// Construct // Construct
pub fn new() -> Request { pub fn new() -> Self {
// GTK // GTK
let widget = Entry::builder() let widget = Entry::builder()
.placeholder_text("URL or search term...") .placeholder_text("URL or search term...")