[ghex/gtk4-port: 79/91] Add shortcuts to GtkShortcutWindow.
- From: Logan Rathbone <larathbone src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ghex/gtk4-port: 79/91] Add shortcuts to GtkShortcutWindow.
- Date: Thu, 12 Aug 2021 23:35:12 +0000 (UTC)
commit cff9adffe3e8f82b2ab90e1d9181452cb113fd73
Author: Logan Rathbone <poprocks gmail com>
Date: Wed Feb 24 00:59:34 2021 -0500
Add shortcuts to GtkShortcutWindow.
This shows how many more shortcuts are needed!
src/ghex-application-window.c | 16 +++++++
src/help-overlay.ui | 100 +++++++++++++++++++++++++++++++++++++++---
2 files changed, 111 insertions(+), 5 deletions(-)
---
diff --git a/src/ghex-application-window.c b/src/ghex-application-window.c
index 621edcbe..b8acec26 100644
--- a/src/ghex-application-window.c
+++ b/src/ghex-application-window.c
@@ -1776,6 +1776,15 @@ ghex_application_window_class_init(GHexApplicationWindowClass *klass)
/* SHORTCUTS */
+ /* ensure these are synced with help-overlay.ui */
+
+ /* F1 - show about dialog */
+ gtk_widget_class_add_binding_action (widget_class,
+ GDK_KEY_F1,
+ 0,
+ "ghex.about",
+ NULL); /* no args. */
+
/* Ctrl+F - find */
gtk_widget_class_add_binding_action (widget_class,
GDK_KEY_f,
@@ -1811,6 +1820,13 @@ ghex_application_window_class_init(GHexApplicationWindowClass *klass)
"ghex.copy-special",
NULL);
+ /* Ctrl+P - print */
+ gtk_widget_class_add_binding_action (widget_class,
+ GDK_KEY_p,
+ GDK_CONTROL_MASK,
+ "ghex.print",
+ NULL);
+
/* Ctrl+W - close tab */
gtk_widget_class_add_binding (widget_class,
GDK_KEY_w,
diff --git a/src/help-overlay.ui b/src/help-overlay.ui
index 22988af6..0d66b682 100644
--- a/src/help-overlay.ui
+++ b/src/help-overlay.ui
@@ -1,29 +1,119 @@
<!-- vim: ts=2 sw=2
-->
+
+<!-- ensure these are synced with ghex-application-window.c -->
+
<interface>
<object class="GtkShortcutsWindow" id="help_overlay">
<child>
<object class="GtkShortcutsSection">
+ <property name="max-height">12</property>
+
<child>
<object class="GtkShortcutsGroup">
- <property name="title">General</property>
+ <property name="title" translatable="true">Find and
Replace</property>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control>f</property>
+ <property name="title"
translatable="true">Find</property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control>h</property>
+ <property name="title"
translatable="true">Find and replace</property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control>j</property>
+ <property name="title"
translatable="true">Jump to byte</property>
+ </object>
+ </child>
+
+ </object>
+ </child> <!-- /Find and Replace -->
+
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="title"
translatable="true">Clipboard</property>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control><Shift>c</property>
+ <property name="title"
translatable="true">Copy special</property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control><Shift>v</property>
+ <property name="title"
translatable="true">Paste special</property>
+ </object>
+ </child>
+
+ </object>
+ </child> <!-- /Data Operations -->
+
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="title" translatable="true">Files</property>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control>w</property>
+ <property name="title"
translatable="true">Close tab</property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control>s</property>
+ <property name="title"
translatable="true">Save file</property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control>Page_Down</property>
+ <property name="title"
translatable="true">Switch to next tab</property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property
name="accelerator"><Control>Page_Up</property>
+ <property name="title"
translatable="true">Switch to previous tab</property>
+ </object>
+ </child>
+
+ </object>
+ </child> <!-- /Files -->
+
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="title" translatable="true">General</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">F1</property>
- <property name="title">Show About
Dialog</property>
+ <property name="title"
translatable="true">Show About dialog</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property
name="accelerator"><Control>f</property>
- <property name="title">Find</property>
+ <property
name="accelerator"><Control>p</property>
+ <property name="title"
translatable="true">Print the hex file</property>
</object>
</child>
</object>
- </child>
+ </child> <!-- /General -->
+
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]