diff --git a/src/app/browser.rs b/src/app/browser.rs index f2e4f70b..7f639f1b 100644 --- a/src/app/browser.rs +++ b/src/app/browser.rs @@ -3,12 +3,37 @@ use gtk::{Application, ApplicationWindow}; -pub fn new(app: &Application) -> ApplicationWindow +pub fn new( + app : &Application, + width : i32, + height : i32 +) -> ApplicationWindow { - return ApplicationWindow::builder().application(app) - .default_width(640) - .default_height(480) - .titlebar(&header::new()) - .child(&main::new()) - .build(); + return ApplicationWindow::builder() + + // Relate + .application( + app + ) + + // Tuneup + .default_width( + width + ) + + .default_height( + height + ) + + // Init components + .titlebar( + &header::new() + ) + + .child( + &main::new() + ) + + // Make + .build(); } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 34f35019..e64b26a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,15 @@ #[path = "app/browser.rs"] mod browser; -use gtk::prelude::*; -use gtk::{glib, Application}; +use gtk::prelude::{ + ApplicationExt, + ApplicationExtManual, + GtkWindowExt +}; + +use gtk::{ + Application, + glib +}; fn main() -> glib::ExitCode { @@ -13,7 +21,9 @@ fn main() -> glib::ExitCode |app| { browser::new( - app + app, + 640, + 480 ).present(); } );