mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
reorder dependencies
This commit is contained in:
parent
043661282c
commit
b3faf9a1cb
1 changed files with 25 additions and 24 deletions
31
src/main.rs
31
src/main.rs
|
|
@ -6,10 +6,20 @@ use gtk::prelude::{ApplicationExt, ApplicationExtManual, GtkApplicationExt, GtkW
|
|||
|
||||
use gtk::{glib, Application};
|
||||
|
||||
fn main() -> glib::ExitCode {
|
||||
// Init meta
|
||||
const APP_ID: &str = "io.github.yggverse.Yoda";
|
||||
const APP_ID: &str = "io.github.yggverse.Yoda";
|
||||
|
||||
fn main() -> glib::ExitCode {
|
||||
// Init app
|
||||
let app = Application::builder().application_id(APP_ID).build();
|
||||
|
||||
// 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
|
||||
app.connect_activate({
|
||||
// Init profile directory
|
||||
let mut fs = gtk::glib::user_config_dir();
|
||||
|
||||
|
|
@ -29,18 +39,9 @@ fn main() -> glib::ExitCode {
|
|||
Err(e) => panic!("Failed to connect profile database: {e}"),
|
||||
};
|
||||
|
||||
// Init app
|
||||
let app = Application::builder().application_id(APP_ID).build();
|
||||
|
||||
// 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
|
||||
app.connect_activate(move |app| {
|
||||
browser::new(&app, &db, 640, 480).present();
|
||||
move |this| {
|
||||
browser::new(&this, &db, 640, 480).present();
|
||||
}
|
||||
});
|
||||
|
||||
// Start
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue