Animate screen brightness change
Review Request #121995 - Created Jan. 11, 2015 and submitted
|Kai Uwe Broulik|
Use a QPropertyAnimation to animate screen brightness changes, if supported by your configuration (enough steps available).
Using Kernel 3.18 it now reports ~900 steps for my display and so when idle the screen dims smoothly, when changing brightness or using the brightness keys, the screen brightness changes smoothly with the OSD reporting the proper value and battery monitor sliders adjusting slightly delayed. Didn't test using the helper rather than XRandr.
Does the brightness animation really make sense when falling back to a brightness setter helper is needed? action.execute() will block.
What if you check in PowerDevilUPowerBackend::setBrightnessValue if brightness control is supported, if not to the helper stuff there otherwise start the animation which calls this method which does only m_brightnessControl->setBrightnessValue(value)?
- Add config options for duration and threshold
- Don't mess with the helper, it's too fragile to be called repeatedly
- Cleanup a bit
Revision 2 (+62 -14)