Make sure that brightness up/down actions produce visible changes.

Review Request #122343 - Created Jan. 31, 2015 and submitted

Information
Nikita Skovoroda
powerdevil
Reviewers
solid
broulik

Atm when maxBrightness > 100, brightness up/down actions could produce no visible change in some situations.
For example, when maxBrightness = 1000, brightness = 496:
Brightness is shown as 50% (rounded to whole pecents).
«Brightness up» action increases the brightness by 1 to 497 and rounds it to the nearest step upwards 500, 50%.
* The above logic is correct for, for example, brightness = 480 (so that it's raised to 500 = 50%, not to 530 = 53%), but in the described situation, when the brightness was manually set to 496 through a slider, the action does no visible change, which is unexpected.

This patch solves this issue by comparing the visible percentage of the resulting brightness to the visible percentage of the original brightness and adding/subtracting one more step if there was no visible change.

Compiles. Trivial, should not break anything.

Nikita Skovoroda
Kai Uwe Broulik
Nikita Skovoroda
Review request changed

Status: Closed (submitted)

Loading...