add possibility to edit icons for toolbar actions in toolbar editor
Hi, first time contributor here, this is my first draft PR, and I just started to know Krita source code and C++ (I have a background of frontend dev - JS;TS,Java, so some code can probably look weird... but I was mostly studying the examples of the existing code). I made a post https://krita-artists.org/t/change-icon-in-configure-toolbars-feature-im-new-dev-here-so-need-to-discuss-this/142302/4, and got a few responses, so decided to make a draft PR for early feedback.
I marked the actions in green which already have custom icon assigned.
For icons list I didn't know much options to get a full list of icons in the code, so I had in mind these 2:
-
(Currently used) Reuse KisIconUtils list, s_icons to be precise, I added a method which returns distinct sorted list of all "requested" icons in the app. At stage when [Configure Toolbars] is open it works, but maybe if this function will be called at some early app init stages then it won't have the full list of icons (so at least comment with a note could be added)
-
Just write a manual list of icons to be used - that would be a pretty big list.
In my forum post user Michelist responded that there will be a shift to QT6, but I don't know how the icons will be managed there, so yeah - currently I have these 2 ideas for now.
Opening and closing the Krita app also reflects the changed icons, I needed to add the additional method to main window to manually handle this because the app didn't do that.
This is a draft for now, I still need to test this on Android, Mac and Linux, add unit tests (maybe? I need to study examples if there are any in the code); do some cleanups of the code like remove debug logs, rename something - but the general working code is here.
Also there is no way back to set the default icon for individual action, I think that [Defaults] Button does the job. And there is no way back to set the empty icon - I think I will add <empty> icon in the [Choose Icon] dialog or [Delete Icon] next to [Change Icon].
Test Plan
Open the app, Settings -> Configure toolbars
(Tell us how to test the changes you made.)
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. -
Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?
