Skip to content

Commit e2c4294

Browse files
committed
power applet: Use step up/down when scrolling on the brightness
sliders instead of directly setting a value. Change the minimum brightness value to 0, as csd-power will take care of clamping to a minimum value. ref: linuxmint/mint21-beta#24 linuxmint/cinnamon-settings-daemon@c19083ebd
1 parent 8d8180f commit e2c4294

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

files/usr/share/cinnamon/applets/[email protected]/applet.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,13 @@ class BrightnessSlider extends PopupMenu.PopupSliderMenuItem {
307307
let direction = event.get_scroll_direction();
308308

309309
if (direction == Clutter.ScrollDirection.DOWN) {
310-
this._value = Math.max(0, this._value - this._step);
310+
this._proxy.StepDownRemote(function() {});
311311
}
312312
else if (direction == Clutter.ScrollDirection.UP) {
313-
this._value = Math.min(1, this._value + this._step);
313+
this._proxy.StepUpRemote(function() {});
314314
}
315315

316316
this._slider.queue_repaint();
317-
this.emit('value-changed', this._value);
318317
}
319318
}
320319

@@ -344,7 +343,7 @@ class CinnamonPowerApplet extends Applet.TextIconApplet {
344343

345344
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
346345

347-
this.brightness = new BrightnessSlider(this, _("Brightness"), "display-brightness", BrightnessBusName, 0.01);
346+
this.brightness = new BrightnessSlider(this, _("Brightness"), "display-brightness", BrightnessBusName, 0);
348347
this.keyboard = new BrightnessSlider(this, _("Keyboard backlight"), "keyboard-brightness", KeyboardBusName, 0);
349348
this.menu.addMenuItem(this.brightness);
350349
this.menu.addMenuItem(this.keyboard);

0 commit comments

Comments
 (0)