Skip to content

OSD: Don't wrap current index around when holding left/right key

ivan tkachenko requested to merge work/ratijas/running-in-circles into master

Wrapping such lists around does not always make sense, for example, when pressing and holding down an arrow key. The expected behavior is to stop at bounds instead of endlessly running around in circles, while leaving the possibility to wrap by pressing down the directional key one more time.

This is the approach that OS X used for their application switching OSD as well as for many other stuff. I expect to see this kind of wrapping behavior more and more throughout Plasma, including our own Plasma/KWin Task Switchers like "Large Icons", which is why the wrappingAdd function here is implemented as a generic QML method ready to be factored out as a library function.

Merge request reports