mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
return Self implementation
This commit is contained in:
parent
bdad712690
commit
003486e3ed
@ -13,7 +13,7 @@ pub struct Header {
|
||||
|
||||
impl Header {
|
||||
// Construct
|
||||
pub fn new() -> Header {
|
||||
pub fn new() -> Self {
|
||||
let tray = Tray::new();
|
||||
let subject = Subject::new();
|
||||
|
||||
|
@ -7,7 +7,7 @@ pub struct Description {
|
||||
|
||||
impl Description {
|
||||
// Construct
|
||||
pub fn new() -> Description {
|
||||
pub fn new() -> Self {
|
||||
let widget = Label::builder()
|
||||
.css_classes(["subtitle"])
|
||||
.single_line_mode(true)
|
||||
|
@ -14,7 +14,7 @@ pub struct Subject {
|
||||
|
||||
impl Subject {
|
||||
// Construct
|
||||
pub fn new() -> Subject {
|
||||
pub fn new() -> Self {
|
||||
let title = Title::new();
|
||||
let description = Description::new();
|
||||
|
||||
|
@ -8,7 +8,7 @@ pub struct Title {
|
||||
|
||||
impl Title {
|
||||
// Construct
|
||||
pub fn new() -> Title {
|
||||
pub fn new() -> Self {
|
||||
let widget = gtk::Label::builder()
|
||||
.css_classes(["title"])
|
||||
.single_line_mode(true)
|
||||
|
@ -5,7 +5,7 @@ pub struct Menu {
|
||||
}
|
||||
|
||||
impl Menu {
|
||||
pub fn new() -> Menu {
|
||||
pub fn new() -> Self {
|
||||
// Init model
|
||||
let model_tab = gio::Menu::new();
|
||||
model_tab.append(Some("New"), Some("win.tab_append"));
|
||||
|
@ -11,7 +11,7 @@ pub struct Tray {
|
||||
}
|
||||
|
||||
impl Tray {
|
||||
pub fn new() -> Tray {
|
||||
pub fn new() -> Self {
|
||||
let menu = Menu::new();
|
||||
let tab = Tab::new();
|
||||
|
||||
|
@ -6,7 +6,7 @@ pub struct Tab {
|
||||
|
||||
impl Tab {
|
||||
// Construct
|
||||
pub fn new() -> Tab {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Button::builder()
|
||||
.action_name("win.tab_append")
|
||||
|
@ -13,7 +13,7 @@ pub struct Main {
|
||||
|
||||
impl Main {
|
||||
// Construct
|
||||
pub fn new() -> Main {
|
||||
pub fn new() -> Self {
|
||||
// Init components
|
||||
let tab = Arc::new(Tab::new());
|
||||
|
||||
|
@ -6,7 +6,7 @@ pub struct Title {
|
||||
|
||||
impl Title {
|
||||
// Construct
|
||||
pub fn new() -> Title {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Label::builder()
|
||||
.label("New page")
|
||||
|
@ -6,7 +6,7 @@ pub struct Content {
|
||||
|
||||
impl Content {
|
||||
// Construct
|
||||
pub fn new() -> Content {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Box::builder().orientation(Orientation::Vertical).build(),
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ pub struct Reader {
|
||||
|
||||
impl Reader {
|
||||
// Construct
|
||||
pub fn new() -> Reader {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Label::builder()
|
||||
.halign(Align::Start)
|
||||
|
@ -6,7 +6,7 @@ pub struct Text {
|
||||
|
||||
impl Text {
|
||||
// Construct
|
||||
pub fn new() -> Text {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: ScrolledWindow::builder().build(),
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ pub struct Reader {
|
||||
|
||||
impl Reader {
|
||||
// Construct
|
||||
pub fn new() -> Reader {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Label::builder()
|
||||
.halign(Align::Start)
|
||||
|
@ -14,7 +14,7 @@ pub struct Meta {
|
||||
}
|
||||
|
||||
impl Meta {
|
||||
pub fn new() -> Meta {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
title: GString::new(),
|
||||
description: GString::new(),
|
||||
|
@ -6,7 +6,7 @@ pub struct Base {
|
||||
|
||||
impl Base {
|
||||
// Construct
|
||||
pub fn new() -> Base {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Button::builder()
|
||||
.action_name("win.tab_page_base")
|
||||
|
@ -6,7 +6,7 @@ pub struct Bookmark {
|
||||
|
||||
impl Bookmark {
|
||||
// Construct
|
||||
pub fn new() -> Bookmark {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Button::builder()
|
||||
.action_name("win.tab_page_bookmark")
|
||||
|
@ -6,7 +6,7 @@ pub struct Back {
|
||||
|
||||
impl Back {
|
||||
// Construct
|
||||
pub fn new() -> Back {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Button::builder()
|
||||
.action_name("win.tab_page_history_back")
|
||||
|
@ -6,7 +6,7 @@ pub struct Forward {
|
||||
|
||||
impl Forward {
|
||||
// Construct
|
||||
pub fn new() -> Forward {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Button::builder()
|
||||
.action_name("win.tab_page_history_forward")
|
||||
|
@ -14,7 +14,7 @@ pub struct History {
|
||||
|
||||
impl History {
|
||||
// Construct
|
||||
pub fn new() -> History {
|
||||
pub fn new() -> Self {
|
||||
// init components
|
||||
let back = Back::new();
|
||||
let forward = Forward::new();
|
||||
|
@ -24,7 +24,7 @@ pub struct Navigation {
|
||||
}
|
||||
|
||||
impl Navigation {
|
||||
pub fn new() -> Navigation {
|
||||
pub fn new() -> Self {
|
||||
// Init components
|
||||
let base = Base::new();
|
||||
let history = History::new();
|
||||
|
@ -6,7 +6,7 @@ pub struct Reload {
|
||||
|
||||
impl Reload {
|
||||
// Construct
|
||||
pub fn new() -> Reload {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Button::builder()
|
||||
.action_name("win.tab_page_reload")
|
||||
|
@ -10,7 +10,7 @@ pub struct Request {
|
||||
|
||||
impl Request {
|
||||
// Construct
|
||||
pub fn new() -> Request {
|
||||
pub fn new() -> Self {
|
||||
// GTK
|
||||
let widget = Entry::builder()
|
||||
.placeholder_text("URL or search term...")
|
||||
|
Loading…
x
Reference in New Issue
Block a user