mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
use canonical module subfolder tree
This commit is contained in:
parent
80783d2ae4
commit
8969899a2f
24 changed files with 0 additions and 23 deletions
37
src/browser/mod.rs
Normal file
37
src/browser/mod.rs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
mod header;
|
||||
mod main;
|
||||
|
||||
use gtk::{
|
||||
gio::ActionEntry,
|
||||
prelude::{ActionMapExtManual, GtkWindowExt},
|
||||
Application, ApplicationWindow,
|
||||
};
|
||||
|
||||
pub fn new(app: &Application, width: i32, height: i32) -> ApplicationWindow {
|
||||
// Init browser window
|
||||
let browser = ApplicationWindow::builder()
|
||||
.default_width(width)
|
||||
.default_height(height)
|
||||
.application(app)
|
||||
.titlebar(&header::new())
|
||||
.child(&main::new())
|
||||
.build();
|
||||
|
||||
// Init actions
|
||||
let action_debug = ActionEntry::builder("debug")
|
||||
.activate(|browser: &ApplicationWindow, _, _| {
|
||||
browser.emit_enable_debugging(true);
|
||||
})
|
||||
.build();
|
||||
|
||||
let action_quit = ActionEntry::builder("quit")
|
||||
.activate(|browser: &ApplicationWindow, _, _| {
|
||||
browser.close();
|
||||
})
|
||||
.build();
|
||||
|
||||
browser.add_action_entries([action_debug, action_quit]);
|
||||
|
||||
// Done
|
||||
browser
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue