apply rustfmt

This commit is contained in:
yggverse 2024-09-20 18:02:10 +03:00
parent e6e81e846a
commit f8d938a8af
24 changed files with 253 additions and 611 deletions

View file

@ -1,83 +1,39 @@
#[path = "browser/header.rs"] mod header;
#[path = "browser/main.rs"] mod main;
#[path = "browser/header.rs"]
mod header;
#[path = "browser/main.rs"]
mod main;
use gtk::{
Application,
ApplicationWindow,
gio::ActionEntry,
prelude::{
ActionMapExtManual,
GtkWindowExt
}
prelude::{ActionMapExtManual, GtkWindowExt},
Application, ApplicationWindow,
};
pub fn new(
app: &Application,
width: i32,
height: i32
) -> ApplicationWindow
{
pub fn new(app: &Application, width: i32, height: i32) -> ApplicationWindow {
// Init browser window
let browser = ApplicationWindow::builder()
// Tuneup
.default_width(
width
)
.default_height(
height
)
// Relate
.application(
app
)
// Init components
.titlebar(
&header::new()
)
.child(
&main::new()
)
// Make
.default_width(width)
.default_height(height)
.application(app)
.titlebar(&header::new())
.child(&main::new())
.build();
// Init actions
let action_debug = ActionEntry::builder("debug")
// Init actions
let action_debug = ActionEntry::builder("debug")
.activate(|browser: &ApplicationWindow, _, _| {
browser.emit_enable_debugging(true);
})
.build();
.activate(
|browser: &ApplicationWindow, _, _|
{
browser.emit_enable_debugging(
true
);
}
)
let action_quit = ActionEntry::builder("quit")
.activate(|browser: &ApplicationWindow, _, _| {
browser.close();
})
.build();
.build();
let action_quit = ActionEntry::builder("quit")
.activate(
|browser: &ApplicationWindow, _, _|
{
browser.close();
}
)
.build();
browser.add_action_entries(
[
action_debug,
action_quit
]
);
browser.add_action_entries([action_debug, action_quit]);
// Done
browser
}
}