This is a proposal for adding a set of internal constant values that we should use for all the buttons and icons sizes inside Krita. After discussing it with Scott, we think it would be the best way to go...
Why:
-We need to be able to control the size of buttons independently from the theme selected.
For now we have random hardcoded values for almost each button, so setting some constants in a single place that we should reuse everywhere would be better for consistency and maintainability.
-We should probably not reuse Qt-provided constants, as those are theme dependant and not really possible to control as far as I could see.
-Having such constants will give us the possiblity in the long term to fix some scaling issues, and to make it easy for users to use a custom scale for buttons/icons. (example: currently, at least on Linux, when changing the display scaling, it doesn't change the size of all our hardcoded-values... So we could find a way to handle such scaling internally, or just provide a user setting to scale all the buttons/icons.)
How:
-define some constants in an easy-to-access place (KisIconUtils ?)
-replace all the hardcoded size values for buttons and icons with those constants. It could probably be possible to set them in a few strategical places for the different types of buttons we have, instead of setting it for each and every button like we do currently.
After analyzing our current buttons and icons with both Fusion and Breeze, and making a few tests, I propose to define the following set of values.
Buttons/Icons sizes (in px):
- Default size: 32/22
(used in Toolbars, and everywhere else unless stated otherwise)
- ToolBox: 26/16 (by default; + all the other optional icon sizes, with buttons size 10px bigger)
- Small buttons: 24/16 (in places where it's good to save space, like the set of curve buttons in brush settings, or the buttons in the transform tool options...)
- Dockers titlebar buttons: 18/16
For buttons on layers (visible, lock, alpha...), I suggest to use the Small buttons size for the width, and as minimum for the height; height is normally a bit higher anyway... (and even higher when increasing thumbnails size)
Icons-only (not directly on buttons):
-Big icons: 32 (like icons on the left of "Create new document", and left of "Configure Krita"...)
-Small icons: 16 (used at least for Layer types... currently it's 12, but we can probaly use 16 as minimum)