[gthumb] image rotation: converted accelerators to customizable shortcuts
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] image rotation: converted accelerators to customizable shortcuts
- Date: Sun, 24 Nov 2019 12:29:31 +0000 (UTC)
commit f4a23f689562fb3c033b9bcff048bfea8bbf55d5
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Nov 9 18:22:58 2019 +0100
image rotation: converted accelerators to customizable shortcuts
extensions/image_rotation/callbacks.c | 36 +++++++++++------------------------
extensions/image_rotation/callbacks.h | 2 --
extensions/image_rotation/main.c | 1 -
3 files changed, 11 insertions(+), 28 deletions(-)
---
diff --git a/extensions/image_rotation/callbacks.c b/extensions/image_rotation/callbacks.c
index e5b219b5..bb53c9d2 100644
--- a/extensions/image_rotation/callbacks.c
+++ b/extensions/image_rotation/callbacks.c
@@ -42,6 +42,12 @@ static const GActionEntry actions[] = {
};
+static const GthShortcut shortcuts[] = {
+ { "rotate-right", N_("Rotate Right"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER,
GTH_SHORTCUT_CATEGORY_FILE_EDIT, "bracketright" },
+ { "rotate-left", N_("Rotate Left"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER,
GTH_SHORTCUT_CATEGORY_FILE_EDIT, "bracketleft" },
+};
+
+
static const GthMenuEntry tools1_action_entries[] = {
{ N_("Rotate Left"), "win.rotate-left", "bracketleft", "object-rotate-left-symbolic" },
{ N_("Rotate Right"), "win.rotate-right", "bracketright", "object-rotate-right-symbolic" },
@@ -84,6 +90,11 @@ ir__gth_browser_construct_cb (GthBrowser *browser)
actions,
G_N_ELEMENTS (actions),
browser);
+
+ gth_window_add_shortcuts (GTH_WINDOW (browser),
+ shortcuts,
+ G_N_ELEMENTS (shortcuts));
+
gth_menu_manager_append_entries (gth_browser_get_menu_manager (browser,
GTH_BROWSER_MENU_MANAGER_TOOLS),
tools1_action_entries,
G_N_ELEMENTS (tools1_action_entries));
@@ -108,31 +119,6 @@ ir__gth_browser_update_sensitivity_cb (GthBrowser *browser)
}
-gpointer
-ir__gth_browser_file_list_key_press_cb (GthBrowser *browser,
- GdkEventKey *event)
-{
- gpointer result = NULL;
-
- switch (event->keyval) {
- case GDK_KEY_bracketright:
- gth_browser_activate_rotate_right (NULL, NULL, browser);
- result = GINT_TO_POINTER (1);
- break;
-
- case GDK_KEY_bracketleft:
- gth_browser_activate_rotate_left (NULL, NULL, browser);
- result = GINT_TO_POINTER (1);
- break;
-
- default:
- break;
- }
-
- return result;
-}
-
-
static void
viewer_image_changed_cb (GtkWidget *widget,
GthBrowser *browser)
diff --git a/extensions/image_rotation/callbacks.h b/extensions/image_rotation/callbacks.h
index 990773e0..b20c0b2e 100644
--- a/extensions/image_rotation/callbacks.h
+++ b/extensions/image_rotation/callbacks.h
@@ -26,8 +26,6 @@
void ir__gth_browser_construct_cb (GthBrowser *browser);
void ir__gth_browser_update_sensitivity_cb (GthBrowser *browser);
-gpointer ir__gth_browser_file_list_key_press_cb (GthBrowser *browser,
- GdkEventKey *event);
void ir__gth_browser_activate_viewer_page_cb (GthBrowser *browser);
void ir__gth_browser_deactivate_viewer_page_cb (GthBrowser *browser);
diff --git a/extensions/image_rotation/main.c b/extensions/image_rotation/main.c
index 6c7f59bc..cfc3dd8a 100644
--- a/extensions/image_rotation/main.c
+++ b/extensions/image_rotation/main.c
@@ -39,7 +39,6 @@ gthumb_extension_activate (void)
gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK (ir__gth_browser_construct_cb), NULL);
gth_hook_add_callback ("gth-browser-update-sensitivity", 10, G_CALLBACK
(ir__gth_browser_update_sensitivity_cb), NULL);
- gth_hook_add_callback ("gth-browser-file-list-key-press", 10, G_CALLBACK
(ir__gth_browser_file_list_key_press_cb), NULL);
gth_hook_add_callback ("gth-browser-activate-viewer-page", 10, G_CALLBACK
(ir__gth_browser_activate_viewer_page_cb), NULL);
gth_hook_add_callback ("gth-browser-deactivate-viewer-page", 10, G_CALLBACK
(ir__gth_browser_deactivate_viewer_page_cb), NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]