mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-10 20:51:45 +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::{
|
use gtk::prelude::{
|
||||||
ApplicationExt,
|
ApplicationExt,
|
||||||
ApplicationExtManual,
|
ApplicationExtManual,
|
||||||
|
GtkApplicationExt,
|
||||||
GtkWindowExt
|
GtkWindowExt
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -13,10 +14,29 @@ use gtk::{
|
|||||||
|
|
||||||
fn main() -> glib::ExitCode
|
fn main() -> glib::ExitCode
|
||||||
{
|
{
|
||||||
|
// Init app
|
||||||
let app = Application::builder().application_id(
|
let app = Application::builder().application_id(
|
||||||
"io.github.yggverse.Yoda.app"
|
"io.github.yggverse.Yoda.app"
|
||||||
).build();
|
).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.connect_activate(
|
||||||
|app|
|
|app|
|
||||||
{
|
{
|
||||||
@ -28,5 +48,6 @@ fn main() -> glib::ExitCode
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Start
|
||||||
app.run()
|
app.run()
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user