[Sugar-devel] [PATCH Browse] Change back/forward navigation shortcut to Alt modifier SL #3536

Manuel Kaufmann humitos at gmail.com
Fri Sep 21 19:43:06 EDT 2012


Signed-off-by: Manuel Quiñones <manuq at laptop.org>
Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
---
 webactivity.py | 14 ++++++++------
 webtoolbar.py  |  2 ++
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/webactivity.py b/webactivity.py
index 24f3b44..e911337 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -449,12 +449,6 @@ class WebActivity(activity.Activity):
             elif key_name == '0':
                 _logger.debug('keyboard: Actual size')
                 browser.set_zoom_level(ZOOM_ORIGINAL)
-            elif key_name == 'Left':
-                _logger.debug('keyboard: Go back')
-                browser.go_back()
-            elif key_name == 'Right':
-                _logger.debug('keyboard: Go forward')
-                browser.go_forward()
             elif key_name == 'r':
                 _logger.debug('keyboard: Reload')
                 browser.reload()
@@ -465,6 +459,14 @@ class WebActivity(activity.Activity):
 
             return True
 
+        elif event.get_state() & Gdk.ModifierType.MOD1_MASK:
+            if key_name == 'Left':
+                _logger.debug('keyboard: Go back')
+                browser.go_back()
+            elif key_name == 'Right':
+                _logger.debug('keyboard: Go forward')
+                browser.go_forward()
+
         elif key_name in ('KP_Up', 'KP_Down', 'KP_Left', 'KP_Right'):
             scrolled_window = browser.get_parent()
 
diff --git a/webtoolbar.py b/webtoolbar.py
index 28bc015..5193d89 100644
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -269,6 +269,7 @@ class PrimaryToolbar(ToolbarBase):
 
         self._back = ToolButton('go-previous-paired')
         self._back.set_tooltip(_('Back'))
+        self._back.props.accelerator = '<Alt>Left'
         self._back.props.sensitive = False
         self._back.connect('clicked', self._go_back_cb)
         toolbar.insert(self._back, -1)
@@ -283,6 +284,7 @@ class PrimaryToolbar(ToolbarBase):
 
         self._forward = ToolButton('go-next-paired')
         self._forward.set_tooltip(_('Forward'))
+        self._forward.props.accelerator = '<Alt>Right'
         self._forward.props.sensitive = False
         self._forward.connect('clicked', self._go_forward_cb)
         toolbar.insert(self._forward, -1)
-- 
1.7.11.4



More information about the Sugar-devel mailing list