[gthumb] shortcuts: register the file list keybindings as read-only
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] shortcuts: register the file list keybindings as read-only
- Date: Sun, 24 Nov 2019 12:37:15 +0000 (UTC)
commit df0f54703f6d5471d9e17dcad619807da39cd0a5
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri Nov 22 10:49:05 2019 +0100
shortcuts: register the file list keybindings as read-only
To correctly check for collisions.
gthumb/gth-browser-actions-entries.h | 60 ++++++++++++++++++++++++++++++++++++
gthumb/gth-shortcut.c | 8 +++++
2 files changed, 68 insertions(+)
---
diff --git a/gthumb/gth-browser-actions-entries.h b/gthumb/gth-browser-actions-entries.h
index c1c83390..011e2996 100644
--- a/gthumb/gth-browser-actions-entries.h
+++ b/gthumb/gth-browser-actions-entries.h
@@ -121,6 +121,66 @@ static const GthShortcut gth_browser_shortcuts[] = {
{ "file-list-select-all", N_("Select all"), GTH_SHORTCUT_CONTEXT_BROWSER,
GTH_SHORTCUT_CATEGORY_NAVIGATION, "<Primary>a" },
{ "file-list-unselect-all", N_("Select none"), GTH_SHORTCUT_CONTEXT_BROWSER,
GTH_SHORTCUT_CATEGORY_NAVIGATION, "<Primary><Shift>a" },
+
+ /* file list keybindings (read only) */
+
+ { "file-list-move-cursor-right", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "Right" },
+ { "file-list-move-cursor-right", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_Right" },
+ { "file-list-move-cursor-left", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "Left" },
+ { "file-list-move-cursor-left", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_Left" },
+ { "file-list-move-cursor-down", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "Down" },
+ { "file-list-move-cursor-down", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_Down" },
+ { "file-list-move-cursor-up", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "Up" },
+ { "file-list-move-cursor-up", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_Up" },
+ { "file-list-move-cursor-page-up", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "Page_Up" },
+ { "file-list-move-cursor-page-up", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_Page_Up" },
+ { "file-list-move-cursor-page-down", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "Page_Down" },
+ { "file-list-move-cursor-page-down", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_Page_Down" },
+ { "file-list-move-cursor-begin", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "Home" },
+ { "file-list-move-cursor-begin", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_Home" },
+ { "file-list-move-cursor-end", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "End" },
+ { "file-list-move-cursor-end", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_End" },
+
+ { "file-list-move-cursor-right-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>Right" },
+ { "file-list-move-cursor-right-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_Right" },
+ { "file-list-move-cursor-left-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>Left" },
+ { "file-list-move-cursor-left-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_Left" },
+ { "file-list-move-cursor-down-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>Down" },
+ { "file-list-move-cursor-down-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_Down" },
+ { "file-list-move-cursor-up-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>Up" },
+ { "file-list-move-cursor-up-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_Up" },
+ { "file-list-move-cursor-page-up-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>Page_Up" },
+ { "file-list-move-cursor-page-up-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_Page_Up" },
+ { "file-list-move-cursor-page-down-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>Page_Down" },
+ { "file-list-move-cursor-page-down-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_Page_Down" },
+ { "file-list-move-cursor-begin-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>Home" },
+ { "file-list-move-cursor-begin-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_Home" },
+ { "file-list-move-cursor-end-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>End" },
+ { "file-list-move-cursor-end-keep-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_End" },
+
+ { "file-list-move-cursor-right-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>Right" },
+ { "file-list-move-cursor-right-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>KP_Right" },
+ { "file-list-move-cursor-left-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>Left" },
+ { "file-list-move-cursor-left-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>KP_Left" },
+ { "file-list-move-cursor-down-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>Down" },
+ { "file-list-move-cursor-down-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>KP_Down" },
+ { "file-list-move-cursor-up-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>Up" },
+ { "file-list-move-cursor-up-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>KP_Up" },
+ { "file-list-move-cursor-page-up-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>Page_Up" },
+ { "file-list-move-cursor-page-up-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>KP_Page_Up" },
+ { "file-list-move-cursor-page-down-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>Page_Down" },
+ { "file-list-move-cursor-page-down-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>KP_Page_Down" },
+ { "file-list-move-cursor-begin-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>Home" },
+ { "file-list-move-cursor-begin-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>KP_Home" },
+ { "file-list-move-cursor-end-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>End" },
+ { "file-list-move-cursor-end-expand-selection", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "<Shift>KP_End" },
+
+ { "file-list-select-cursor-item", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "space" },
+ { "file-list-select-cursor-item", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_space" },
+ { "file-list-toggle-cursor-item", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>space" },
+ { "file-list-toggle-cursor-item", NULL, GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_INTERNAL,
GTH_SHORTCUT_CATEGORY_HIDDEN, "<Primary>KP_space" },
+ { "file-list-activate-cursor-item", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "Return" },
+ { "file-list-activate-cursor-item", NULL, GTH_SHORTCUT_CONTEXT_BROWSER |
GTH_SHORTCUT_CONTEXT_INTERNAL, GTH_SHORTCUT_CATEGORY_HIDDEN, "KP_Enter" },
};
diff --git a/gthumb/gth-shortcut.c b/gthumb/gth-shortcut.c
index d9b64c4b..ff00f23b 100644
--- a/gthumb/gth-shortcut.c
+++ b/gthumb/gth-shortcut.c
@@ -219,10 +219,18 @@ gth_shortcut_valid (guint keycode,
case GDK_KEY_Tab:
return FALSE;
+ /* These shortcuts are valid for us but gtk_accelerator_valid
+ * considers them not valid, hence the are added here
+ * explicitly. */
+
case GDK_KEY_Left:
case GDK_KEY_Right:
case GDK_KEY_Up:
case GDK_KEY_Down:
+ case GDK_KEY_KP_Left:
+ case GDK_KEY_KP_Right:
+ case GDK_KEY_KP_Up:
+ case GDK_KEY_KP_Down:
return TRUE;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]