mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
update browser constructor api, prelude required entities only
This commit is contained in:
parent
77303d548e
commit
c27189f1ab
@ -3,12 +3,37 @@
|
|||||||
|
|
||||||
use gtk::{Application, ApplicationWindow};
|
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)
|
return ApplicationWindow::builder()
|
||||||
.default_width(640)
|
|
||||||
.default_height(480)
|
// Relate
|
||||||
.titlebar(&header::new())
|
.application(
|
||||||
.child(&main::new())
|
app
|
||||||
|
)
|
||||||
|
|
||||||
|
// Tuneup
|
||||||
|
.default_width(
|
||||||
|
width
|
||||||
|
)
|
||||||
|
|
||||||
|
.default_height(
|
||||||
|
height
|
||||||
|
)
|
||||||
|
|
||||||
|
// Init components
|
||||||
|
.titlebar(
|
||||||
|
&header::new()
|
||||||
|
)
|
||||||
|
|
||||||
|
.child(
|
||||||
|
&main::new()
|
||||||
|
)
|
||||||
|
|
||||||
|
// Make
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
16
src/main.rs
16
src/main.rs
@ -1,7 +1,15 @@
|
|||||||
#[path = "app/browser.rs"] mod browser;
|
#[path = "app/browser.rs"] mod browser;
|
||||||
|
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::{
|
||||||
use gtk::{glib, Application};
|
ApplicationExt,
|
||||||
|
ApplicationExtManual,
|
||||||
|
GtkWindowExt
|
||||||
|
};
|
||||||
|
|
||||||
|
use gtk::{
|
||||||
|
Application,
|
||||||
|
glib
|
||||||
|
};
|
||||||
|
|
||||||
fn main() -> glib::ExitCode
|
fn main() -> glib::ExitCode
|
||||||
{
|
{
|
||||||
@ -13,7 +21,9 @@ fn main() -> glib::ExitCode
|
|||||||
|app|
|
|app|
|
||||||
{
|
{
|
||||||
browser::new(
|
browser::new(
|
||||||
app
|
app,
|
||||||
|
640,
|
||||||
|
480
|
||||||
).present();
|
).present();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user