[gnome-shell] Fix key navigation on system menu sliders



commit aa569304bc8310cbe19a6bdbc5fca0241b07bf8b
Author: Alejandro Piñeiro <apinheiro igalia com>
Date:   Thu Aug 22 13:15:00 2013 +0200

    Fix key navigation on system menu sliders
    
    Rely key press events management if the menu item contains
    a slider.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706386

 js/ui/slider.js            |    4 ++--
 js/ui/status/brightness.js |    4 ++++
 js/ui/status/volume.js     |    3 +++
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/slider.js b/js/ui/slider.js
index 6005d3d..e0e7867 100644
--- a/js/ui/slider.js
+++ b/js/ui/slider.js
@@ -23,7 +23,7 @@ const Slider = new Lang.Class({
         this.actor.connect('repaint', Lang.bind(this, this._sliderRepaint));
         this.actor.connect('button-press-event', Lang.bind(this, this._startDragging));
         this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
-        this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
+        this.actor.connect('key-press-event', Lang.bind(this, this.onKeyPressEvent));
 
         this._releaseId = this._motionId = 0;
         this._dragging = false;
@@ -168,7 +168,7 @@ const Slider = new Lang.Class({
         return true;
     },
 
-    _onKeyPressEvent: function (actor, event) {
+    onKeyPressEvent: function (actor, event) {
         let key = event.get_key_symbol();
         if (key == Clutter.KEY_Right || key == Clutter.KEY_Left) {
             let delta = key == Clutter.KEY_Right ? 0.1 : -0.1;
diff --git a/js/ui/status/brightness.js b/js/ui/status/brightness.js
index 5e58630..800a7f2 100644
--- a/js/ui/status/brightness.js
+++ b/js/ui/status/brightness.js
@@ -47,6 +47,10 @@ const Indicator = new Lang.Class({
         this._item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) {
             this._slider.startDragging(event);
         }));
+        this._item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) {
+            return this._slider.onKeyPressEvent(actor, event);
+        }));
+
     },
 
     _sliderChanged: function(slider, value) {
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index a6f2882..b696b1a 100644
--- a/js/ui/status/volume.js
+++ b/js/ui/status/volume.js
@@ -44,6 +44,9 @@ const StreamSlider = new Lang.Class({
         this.item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) {
             this._slider.startDragging(event);
         }));
+        this.item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) {
+            return this._slider.onKeyPressEvent(actor, event);
+        }));
 
         this._stream = null;
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]