volume: Add smooth scrolling to adjust output volume
Allow users to smoothly scroll on the volume indicator icon to adjust the volume. Do this by simply passing the scroll event to the slider inside the menu. https://bugzilla.gnome.org/show_bug.cgi?id=687573
This commit is contained in:
@ -636,7 +636,7 @@ const PopupSliderMenuItem = new Lang.Class({
|
||||
return true;
|
||||
},
|
||||
|
||||
_onScrollEvent: function (actor, event) {
|
||||
scroll: function(event) {
|
||||
let direction = event.get_scroll_direction();
|
||||
let delta;
|
||||
|
||||
@ -655,10 +655,15 @@ const PopupSliderMenuItem = new Lang.Class({
|
||||
}
|
||||
|
||||
this._value = Math.min(Math.max(0, this._value + delta), 1);
|
||||
|
||||
this._slider.queue_repaint();
|
||||
this.emit('value-changed', this._value);
|
||||
},
|
||||
|
||||
_onScrollEvent: function(actor, event) {
|
||||
this.scroll(event);
|
||||
},
|
||||
|
||||
_motionEvent: function(actor, event) {
|
||||
let absX, absY;
|
||||
[absX, absY] = event.get_coords();
|
||||
|
Reference in New Issue
Block a user