mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-10 12:41:34 +00:00
init accels
This commit is contained in:
parent
5eb46f07fd
commit
930cb663ba
21
src/main.rs
21
src/main.rs
@ -3,6 +3,7 @@
|
||||
use gtk::prelude::{
|
||||
ApplicationExt,
|
||||
ApplicationExtManual,
|
||||
GtkApplicationExt,
|
||||
GtkWindowExt
|
||||
};
|
||||
|
||||
@ -13,10 +14,29 @@ use gtk::{
|
||||
|
||||
fn main() -> glib::ExitCode
|
||||
{
|
||||
// Init app
|
||||
let app = Application::builder().application_id(
|
||||
"io.github.yggverse.Yoda.app"
|
||||
).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(
|
||||
|app|
|
||||
{
|
||||
@ -28,5 +48,6 @@ fn main() -> glib::ExitCode
|
||||
}
|
||||
);
|
||||
|
||||
// Start
|
||||
app.run()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user