summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoresoleyman <emil@soleyman.com>2019-05-24 15:25:02 -0500
committeresoleyman <emil@soleyman.com>2019-05-28 09:45:40 -0500
commit446da7884914d471ce50f8b327edddbaf0d75ccb (patch)
tree47fc8022528756327710c8000dbc82d37c5e219e /src
parent68b69ab4a4548dc9eb94b89c0174f5a4253a4d7d (diff)
downloadcheese-446da7884914d471ce50f8b327edddbaf0d75ccb.tar.gz
Fix the accelerators
The thumbnail view did not allow users to execute commands such as open, save as, trash, or delete for one or more photo / video thumbnails using keyboard shortcuts such as ctrl+o, ctrl+s, etc... https://gitlab.gnome.org/GNOME/cheese/issues/9
Diffstat (limited to 'src')
-rw-r--r--src/cheese-application.vala2
-rw-r--r--src/cheese-window.vala7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/cheese-application.vala b/src/cheese-application.vala
index c4542be0..f46f3165 100644
--- a/src/cheese-application.vala
+++ b/src/cheese-application.vala
@@ -116,7 +116,7 @@ public class Cheese.Application : Gtk.Application
Environment.set_application_name (_("Cheese"));
Window.set_default_icon_name ("org.gnome.Cheese");
- this.add_accelerator ("space", "app.shoot", null);
+ this.set_accels_for_action ("app.shoot", {"space"});
// FIXME: Push these into the main window initialization.
main_window.setup_ui ();
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 09879fc5..25df09e7 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -1312,6 +1312,13 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
var menu = application.get_menu_by_id ("thumbview-menu");
thumbnail_popup = new Gtk.Menu.from_model (menu);
+
+ application.set_accels_for_action ("app.quit", {"<Primary>q"});
+ application.set_accels_for_action ("app.fullscreen", {"F11"});
+ application.set_accels_for_action ("win.file-open", {"<Primary>o"});
+ application.set_accels_for_action ("win.file-saveas", {"<Primary>s"});
+ application.set_accels_for_action ("win.file-trash", {"Delete"});
+ application.set_accels_for_action ("win.file-delete", {"<Shift>Delete"});
this.add_action_entries (actions, this);