Diffusion Krita 0a19f5760494

Prevent Display Indexing Out of Range Error for `KoToolBox::buttonSize`

Authored by eoinoneill on Dec 9 2019, 4:58 AM.

Description

Prevent Display Indexing Out of Range Error for KoToolBox::buttonSize

Something about my specific development environment was causing a crash due
to QGuiApplication::screens() indexing throwing an Out of Range error.
It likely has something to do with my vertical-right oriented display I
just set up. I'll do more investigation of this issue, and whether its a
QT or GNOME bug. For now, I think preventing a hard crash for simple GUI
button size scaling is probably appropriate. If buttonSize is called
without a valid index, it will simply default to the highest button size
option. In order to track future occurances, it will now print warnings
when an invalid screen index is used.

Details