30~ presets in the popup palette current leads to very tiny icons.
This patch adds the ability for a second row of presets to be added, so the icons won't have to be as tiny.
30 preset slots.
21 preset slots.
dkazakov |
Krita |
30~ presets in the popup palette current leads to very tiny icons.
This patch adds the ability for a second row of presets to be added, so the icons won't have to be as tiny.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Good idea. I wonder if we can extract this logic and put it in a function to isolate what is going on. There is a lot math stuff going on with this file already, so I am always a little concerned that adding more math stuff is going to make this file even harder to understand if we don't try to organize/comment it more.
It would also be nice to add some comment(s) about why we need 2 rows. The reasoning for doing this is hard to figure out just by looking at the code. Something like this would be good in the comments before the logic... "Once we get a lot of presets, the icons get really small. This will make the icons have two rows so the icons can be more legible"... or something similar to that. If someone wants to change it later, that gives them a hint on why this logic was added in the first place.
Hi, @woltherav!
The patch looks and works fine. I'm okay with pushing it into master.
The only bug I could find is the absence of margin between internal and outer circles (see screenshot below). Please add a couple of pixels of margin and push! :)