2024-09-18 20:33:29 +03:00
|
|
|
#[path = "app/browser.rs"] mod browser;
|
|
|
|
|
2024-09-19 00:34:46 +03:00
|
|
|
use gtk::prelude::{
|
|
|
|
ApplicationExt,
|
|
|
|
ApplicationExtManual,
|
2024-09-19 17:06:40 +03:00
|
|
|
GtkApplicationExt,
|
2024-09-19 00:34:46 +03:00
|
|
|
GtkWindowExt
|
|
|
|
};
|
|
|
|
|
|
|
|
use gtk::{
|
|
|
|
Application,
|
|
|
|
glib
|
|
|
|
};
|
2024-09-18 16:24:25 +03:00
|
|
|
|
|
|
|
fn main() -> glib::ExitCode
|
|
|
|
{
|
2024-09-19 17:06:40 +03:00
|
|
|
// Init app
|
2024-09-18 20:33:29 +03:00
|
|
|
let app = Application::builder().application_id(
|
|
|
|
"io.github.yggverse.Yoda.app"
|
|
|
|
).build();
|
2024-09-18 16:24:25 +03:00
|
|
|
|
2024-09-19 17:06:40 +03:00
|
|
|
// Init accels
|
|
|
|
app.set_accels_for_action(
|
|
|
|
"win.tab_append", &["<Ctrl>t"]
|
|
|
|
);
|
|
|
|
|
|
|
|
app.set_accels_for_action(
|
|
|
|
"win.tab_close", &["<Ctrl>q"]
|
|
|
|
);
|
|
|
|
|
|
|
|
app.set_accels_for_action(
|
|
|
|
"win.debug", &["<Ctrl>i"]
|
|
|
|
);
|
|
|
|
|
|
|
|
app.set_accels_for_action(
|
|
|
|
"win.quit", &["<Ctrl>Escape"]
|
|
|
|
);
|
|
|
|
|
|
|
|
// Create new window
|
2024-09-18 16:24:25 +03:00
|
|
|
app.connect_activate(
|
|
|
|
|app|
|
|
|
|
{
|
2024-09-18 20:33:29 +03:00
|
|
|
browser::new(
|
2024-09-19 00:34:46 +03:00
|
|
|
app,
|
|
|
|
640,
|
|
|
|
480
|
2024-09-18 20:33:29 +03:00
|
|
|
).present();
|
2024-09-18 16:24:25 +03:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2024-09-19 17:06:40 +03:00
|
|
|
// Start
|
2024-09-18 16:24:25 +03:00
|
|
|
app.run()
|
|
|
|
}
|