[epiphany/gnome-3-36] Fix back/forward shortcuts and gestures in shortcuts dialogs
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-36] Fix back/forward shortcuts and gestures in shortcuts dialogs
- Date: Fri, 3 Apr 2020 17:25:26 +0000 (UTC)
commit f64243eb8620482367dbf716bb5bab17ef0d7616
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Thu Apr 2 20:53:02 2020 -0500
Fix back/forward shortcuts and gestures in shortcuts dialogs
These shortcuts are inverted in RTL. The shortcuts are working properly;
we just need to fix the shortcuts dialog. Ditto for the gestures.
Fixes #1145
src/resources/gtk/shortcuts-dialog.ui | 8 ++++----
src/window-commands.c | 16 ++++++++++++++++
2 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/src/resources/gtk/shortcuts-dialog.ui b/src/resources/gtk/shortcuts-dialog.ui
index 57a4d31c9..7a0bea5c0 100644
--- a/src/resources/gtk/shortcuts-dialog.ui
+++ b/src/resources/gtk/shortcuts-dialog.ui
@@ -113,28 +113,28 @@
</object>
</child>
<child>
- <object class="GtkShortcutsShortcut">
+ <object class="GtkShortcutsShortcut" id="go-back-shortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Go back to the previous
page</property>
<property name="accelerator"><alt>Left</property>
</object>
</child>
<child>
- <object class="GtkShortcutsShortcut">
+ <object class="GtkShortcutsShortcut" id="go-forward-shortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Go forward to the next
page</property>
<property name="accelerator"><alt>Right</property>
</object>
</child>
<child>
- <object class="GtkShortcutsShortcut">
+ <object class="GtkShortcutsShortcut" id="go-back-gesture">
<property name="visible">True</property>
<property name="shortcut-type">gesture-two-finger-swipe-right</property>
<property name="title" translatable="yes" context="shortcut window">Go back to the previous
page</property>
</object>
</child>
<child>
- <object class="GtkShortcutsShortcut">
+ <object class="GtkShortcutsShortcut" id="go-forward-gesture">
<property name="visible">True</property>
<property name="shortcut-type">gesture-two-finger-swipe-left</property>
<property name="title" translatable="yes" context="shortcut window">Go forward to the next
page</property>
diff --git a/src/window-commands.c b/src/window-commands.c
index 5f03fa253..480d32484 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -550,6 +550,22 @@ window_cmd_show_shortcuts (GSimpleAction *action,
builder = gtk_builder_new_from_resource ("/org/gnome/epiphany/gtk/shortcuts-dialog.ui");
shortcuts_window = GTK_WIDGET (gtk_builder_get_object (builder, "shortcuts-dialog"));
+ if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) {
+ GtkShortcutsShortcut *shortcut;
+
+ shortcut = GTK_SHORTCUTS_SHORTCUT (gtk_builder_get_object (builder, "go-back-shortcut"));
+ g_object_set (shortcut, "accelerator", "<Alt>Right", NULL);
+
+ shortcut = GTK_SHORTCUTS_SHORTCUT (gtk_builder_get_object (builder, "go-forward-shortcut"));
+ g_object_set (shortcut, "accelerator", "<Alt>Left", NULL);
+
+ shortcut = GTK_SHORTCUTS_SHORTCUT (gtk_builder_get_object (builder, "go-back-gesture"));
+ g_object_set (shortcut, "shortcut-type", GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT, NULL);
+
+ shortcut = GTK_SHORTCUTS_SHORTCUT (gtk_builder_get_object (builder, "go-forward-gesture"));
+ g_object_set (shortcut, "shortcut-type", GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT, NULL);
+ }
+
g_signal_connect (shortcuts_window,
"destroy",
G_CALLBACK (gtk_widget_destroyed),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]