Brush Preset History enhancements
I'm not sure if anyone even took notice of https://phabricator.kde.org/T12607 but before it rots here for another 6 months, I went ahead and implemented in a way that works for me.
I ended up adding a context menu to the Brush Preset History docker, and realized there was no way to clear the list or single entries anyway, which together with the quick access to changing update behavior works pretty well for me to keep the most frequent used brushes in the list.
Looks like this:
Tried my best to polish it, but two things felt a bit like rolling dice:
- How to name the setting in kritarc. There's at least 3 naming schemes, "componentSetting", "component.setting" and "component/setting". On top of that, the history is currently saved as just "presethistory". I went for "presethistorySorting" for now.
- Capitalization of the menu entries. Apparently krita uses title case for menus, but there seems to be no clear definition of what a "major word" is that you capitalize. The descriptions themselves may also not be the ultimate choice.
I'm also not super happy how menu section look with Qt (both Fusion and Breeze style) but I guess it can't really be helped here, making a sub-mennu seems a bit crazy here.
Test Plan
Basically, test all menu actions, especially make sure the "Forget " is always correct (or not present when not clicked on a preset), I had an issue with scrolling first. Some feedback on the bubbling algorithm would be nice too, see the task on the reasoning behind it.
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.