rename widget struct entity

This commit is contained in:
yggverse 2024-09-23 14:02:42 +03:00
parent daf276c006
commit 3d44bcb754
3 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ impl Browser {
); );
// Init actions @TODO separated module // Init actions @TODO separated module
widget.gtk().add_action_entries([ widget.window().add_action_entries([
ActionEntry::builder("debug") ActionEntry::builder("debug")
.activate(|this: &ApplicationWindow, _, _| { .activate(|this: &ApplicationWindow, _, _| {
this.emit_enable_debugging(true); this.emit_enable_debugging(true);

View File

@ -1,7 +1,7 @@
use gtk::{Application, ApplicationWindow, Box, HeaderBar}; use gtk::{Application, ApplicationWindow, Box, HeaderBar};
pub struct Browser { pub struct Browser {
gtk: ApplicationWindow, window: ApplicationWindow,
} }
impl Browser { impl Browser {
@ -13,7 +13,7 @@ impl Browser {
default_height: i32, default_height: i32,
) -> Browser { ) -> Browser {
Self { Self {
gtk: ApplicationWindow::builder() window: ApplicationWindow::builder()
.application(application) .application(application)
.default_width(default_width) .default_width(default_width)
.default_height(default_height) .default_height(default_height)
@ -23,7 +23,7 @@ impl Browser {
} }
} }
pub fn gtk(&self) -> &ApplicationWindow { pub fn window(&self) -> &ApplicationWindow {
&self.gtk &self.window
} }
} }

View File

@ -43,7 +43,7 @@ fn main() -> glib::ExitCode {
move |this: &Application| { move |this: &Application| {
browser::Browser::new(this, db.clone(), 640, 480) browser::Browser::new(this, db.clone(), 640, 480)
.widget() .widget()
.gtk() .window()
.present(); .present();
} }
}); });