[gnome-shell] slider: Do not notify on parent's behalf
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] slider: Do not notify on parent's behalf
- Date: Tue, 13 Aug 2019 15:32:37 +0000 (UTC)
commit f0e1dc5715c2bd9226238c1f35ef916d1006a2c4
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Aug 12 17:40:54 2019 +0200
slider: Do not notify on parent's behalf
Instead just use the regular property setter which since commit 3d3dca4aa
already emits the signal and queues a redraw.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1500
js/ui/slider.js | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/slider.js b/js/ui/slider.js
index 7672cf67ef..3e35dbcb26 100644
--- a/js/ui/slider.js
+++ b/js/ui/slider.js
@@ -155,10 +155,8 @@ var Slider = GObject.registerClass({
delta = -dy * SLIDER_SCROLL_STEP;
}
- this._value = Math.min(Math.max(0, this._value + delta), this._maxValue);
+ this.value = Math.min(Math.max(0, this._value + delta), this._maxValue);
- this.queue_repaint();
- this.notify('value');
return Clutter.EVENT_STOP;
}
@@ -177,10 +175,8 @@ var Slider = GObject.registerClass({
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;
- this._value = Math.max(0, Math.min(this._value + delta, this._maxValue));
- this.queue_repaint();
this.emit('drag-begin');
- this.notify('value');
+ this.value = Math.max(0, Math.min(this._value + delta, this._maxValue));
this.emit('drag-end');
return Clutter.EVENT_STOP;
}
@@ -202,9 +198,7 @@ var Slider = GObject.registerClass({
newvalue = 1;
else
newvalue = (relX - handleRadius) / (width - 2 * handleRadius);
- this._value = newvalue * this._maxValue;
- this.queue_repaint();
- this.notify('value');
+ this.value = newvalue * this._maxValue;
}
_getMinimumIncrement() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]