Skip to content

kcms/nightlight: Prevent transition timings overlap

Ismael Asensio requested to merge work/iasensio/nightlight-transition-time into master

Reason for the change

For the custom timings to work, the evening and morning times have to be separated more than the transition time (strict >).

Enforce this minimum distance in the UI instead of showing an error and letting the responsibility to the user (an error would make KWin's NightLightManager resort to default timings 6h/18h)

Test plan

Choose the Custom Timings mode and try to overlap those timings, making them closer (or equal) than the transition time

Bugfixes

No current bugreport fixed, but we could get one if we get into this condition and the actual timings are not those the user set (though we inform of the error with a small message)

Screenshots or screen recordings

Before After
Screenshot_20240719_073238 nightlight-transition-nooverlap

Other commits

  • kcms/nightlight: Minimal clean-up on Custom Times code
    • Remove redundant function
    • Set a consistent step size (5 min) for the transiton time spinbox
    • Fix outdated comment

Merge request reports

Loading