Quantcast
Channel: PowerDevil activity
Viewing all articles
Browse latest Browse all 1704

Jakob Petsovits accepted merge request !350: daemon: Refactor brightness controllers to prep for minBrightness() addition at Plasma / PowerDevil

$
0
0

I set out to implement the PowerDevil changes suggested in plasma-workspace!4117 (comment 923164), but decided that I couldn't be bothered to add another poorly named function in the same existing naming scheme. So I did some internal renaming first, and also refactored the BrightnessLogic class so it can handle valueMin changes at runtime. This sets the stage for a follow-up MR to actually introduce the variable brightness minimum for real.

Commit messages below for your convenience.


daemon: Simplify ScreenBrightnessController method names

A simple "brightness" instead of "screenBrightness" will do fine,now that this functionality is owned by a dedicated class and doesn'thave to compete with keyboard brightness in the same namespace.


daemon: Simplify KeyboardBrightnessController method names

A simple "brightness" instead of "keyboardBrightness" will do fine,now that this functionality is owned by a dedicated class and doesn'thave to compete with screen brightness in the same namespace.


daemon: Calculate brightness logic with runtime minimum value

Instead of a hardcoded valueMin() for all displays via overloading,valueMin becomes part of the BrightnessInfo struct and is set bythe controller classes directly.

This will allow us to pass a configured minimum value later.For now, we're just moving the hardcoded value to the screen andkeyboard brightness controllers respectively.

Furthermore, the BrightnessLogic class now stores its state as asingle BrightnessInfo member variable, instead of mirroring eachof BrightnessInfo's members as a separate variable.


CC @nclarius, hopefully this is not conflicting with any work you might have started already


Viewing all articles
Browse latest Browse all 1704

Trending Articles