draft accels configuration array

This commit is contained in:
yggverse 2024-11-05 04:30:00 +02:00
parent 7d14cfcf94
commit 70df09855e

View File

@ -64,22 +64,25 @@ impl App {
.build(); .build();
// Init accels // Init accels
gobject.set_accels_for_action(&action_debug.detailed_name(), &["<Primary>i"]); let accels_config = &[
gobject.set_accels_for_action(&action_update.detailed_name(), &["<Primary>u"]); (action_page_reload.detailed_name(), &["<Primary>r"]),
gobject.set_accels_for_action(&action_quit.detailed_name(), &["<Primary>Escape"]); (action_debug.detailed_name(), &["<Primary>i"]),
gobject.set_accels_for_action(&action_page_new.detailed_name(), &["<Primary>t"]); (action_page_close.detailed_name(), &["<Primary>q"]),
gobject.set_accels_for_action(&action_page_pin.detailed_name(), &["<Primary>p"]); (action_page_history_back.detailed_name(), &["<Primary>Left"]),
gobject.set_accels_for_action(&action_page_close.detailed_name(), &["<Primary>q"]); (
gobject.set_accels_for_action(&action_page_home.detailed_name(), &["<Primary>h"]); action_page_history_forward.detailed_name(),
gobject.set_accels_for_action( &["<Primary>Right"],
&action_page_history_back.detailed_name(), ),
&["<Primary>Left"], (action_page_home.detailed_name(), &["<Primary>h"]),
); (action_page_new.detailed_name(), &["<Primary>t"]),
gobject.set_accels_for_action( (action_page_pin.detailed_name(), &["<Primary>p"]),
&action_page_history_forward.detailed_name(), (action_quit.detailed_name(), &["<Primary>Escape"]),
&["<Primary>Right"], (action_update.detailed_name(), &["<Primary>u"]),
); ]; // @TODO config
gobject.set_accels_for_action(&action_page_reload.detailed_name(), &["<Primary>r"]);
for (detailed_action_name, &accels) in accels_config {
gobject.set_accels_for_action(detailed_action_name, &accels);
}
// Init components // Init components
let browser = Arc::new(Browser::new( let browser = Arc::new(Browser::new(