File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,29 +176,18 @@ Item {
176176 return ;
177177
178178 var shouldApplyToAll = root .applyToAllMonitors && root .getControllableMonitorCount () > 1 ;
179- if (shouldApplyToAll) {
180- var direction = angle > 0 ? 1 : - 1 ;
181- var baseValue = ! isNaN (monitor .queuedBrightness ) ? monitor .queuedBrightness : monitor .brightness ;
182- var step = monitor .stepSize ;
183- var minValue = monitor .minBrightnessValue ;
184-
185- if (direction > 0 && Settings .data .brightness .enforceMinimum && baseValue < minValue) {
186- baseValue = Math .max (step, minValue);
179+ if (angle > 0 ) {
180+ if (shouldApplyToAll) {
181+ BrightnessService .increaseBrightness ();
187182 } else {
188- baseValue = baseValue + direction * step ;
183+ monitor . increaseBrightness () ;
189184 }
190-
191- var targetValue = Math .max (minValue, Math .min (1 , baseValue));
192-
193- BrightnessService .monitors .forEach (function (m ) {
194- if (m && m .brightnessControlAvailable ) {
195- m .setBrightnessDebounced (targetValue);
196- }
197- });
198- } else if (angle > 0 ) {
199- monitor .increaseBrightness ();
200185 } else if (angle < 0 ) {
201- monitor .decreaseBrightness ();
186+ if (shouldApplyToAll) {
187+ BrightnessService .decreaseBrightness ();
188+ } else {
189+ monitor .decreaseBrightness ();
190+ }
202191 }
203192 }
204193
Original file line number Diff line number Diff line change @@ -478,7 +478,8 @@ Singleton {
478478 }
479479
480480 function setBrightness (value : real ): void {
481- value = Math .max (0 , Math .min (1 , value));
481+ var min = Settings .data .brightness .enforceMinimum && isDdc ? 0.01 : 0 ;
482+ value = Math .max (min, Math .min (1 , value));
482483 var rounded = Math .round (value * 100 );
483484
484485 // Always update internal value and trigger UI feedback immediately
You can’t perform that action at this time.
0 commit comments