Change Icon in Configure Toolbars feature (I'm new dev here, so need to discuss this)

Hey everyone, last few days I finally built the source code for Krita on Windows :partying_face:, and was playing around with the thing which was annoying to me for a while - static actions cannot have user-defined icons.

I found https://bugs.kde.org/show_bug.cgi?id=376101, where was mentioned that this feature was actually in Krita before 2014, but I couldn’t find any source code for that so did my own implementation.

My big first question for now is this: is it something which is worthy for a pull request?

I still need to work on this, like test it on mac, linux and android (have all 3, no idea yet how to build it for these platforms :sweat_smile:), maybe think of some ‘reset’ button etc.. So if it likely to be approved, better I drop this idea now and won’t be so sad as if I spent more time performing a NINJA-PR, surprising everyone and finding out that this is going to be rejected


P.S. icons are saving OK, and I made it that way so these custom icons are reflected even on app close and open. There is no turning back to default icon → I didn’t think that far ahead yet.

2 Likes

:slight_smile: Hello @shlop_op, and welcome to the forum!

I guess it is safe to say that this feature is wanted by so many users that the official Krita developers would have a hard time arguing against your feature if it is safe and stable implemented and tested.
And if you adhere to the standards of good programming, produce clean and good documented code, it is very likely to be accepted. Please obey with your developments that Krita is currently prepared to make a big shift, or a huge step forward and will be ported to Qt6 in the foreseeable future, first nightlies based upon Qt6 are produced regularly by the CI build system (is that its name?), for instance. If you want to take a look at them, here are links to the most recent builds based on Qt6, the links will expire in a few days:
WINDOWS Qt6:
https://invent.kde.org/graphics/krita/-/jobs/3359930/artifacts/download?file_type=archive
MAC Qt6:
https://invent.kde.org/graphics/krita/-/jobs/3359935/artifacts/download?file_type=archive
LINUX Qt6
https://invent.kde.org/graphics/krita/-/jobs/3369651/artifacts/download?file_type=archive

Michelist

1 Like

Does this mean we would be able to select an icon when choosing toolbar items that have no icon?

If yes, that would be wonderful.

I’m an Android user who uses toolbar customizations to get around Krita’s reliance on keyboard shortcuts.

Right now, I only use two items that have no icon (underlined in red) but I would use more if I could shorten them by assigning an icon.

PS Welcome to the forum!

3 Likes

Hi @shlop_op . Does it mean you already have an implementation on Windows and it’s working okay as far as you’re concerned? I see your screenshot shows the button that’s normally not there.

If yes – then I think it’s fine to go ahead and open an MR and ask for feedback there. That should not be too much work at this point. If the response is positive, you can go ahead and test the change on other platforms and polish it to make it through the review.

I see the bug you linked is CONFIRMED, meaning it’s a problem that was already acknowledged. Based on that, the fix probably won’t be rejected without a clear reason.

For other cases where you don’t have the change ready yet, you can get in touch with the developers via IRC and ask if working on something is a good idea. You can find the contact info in the official docs: Introduction to Hacking Krita — Krita Manual 5.2.0 documentation

3 Likes

Hi everyone, thanks for responding!
@Michelist I don’t have a background of C++ and Krita, but I just follow the existing code :slight_smile: . I downloaded the windows Qt6, but the app closes after loading popup, not sure why. Anyway the conflicts with new version will be known from the code side I hope.

@sooz Exactly! I bought an Android tablet and tried krita on it, that’s where it hit me - because I had so many actions in my toolbar on PC without icons. And I wasn’t paying attention because my screen is huge 32”, but even large galaxy tab s10 ultra couldn’t show all of them.

@YRH Thanks for the tip! I made a draft merge request Draft: add possibility to edit icons for toolbar actions in toolbar editor (!2479) · Merge requests · Graphics / Krita · GitLab . And I’ll surely setup IRC after a while, most likely when I will be looking for a new bug or feature to work on

2 Likes

Try disabling the News on the welcome page (it’s a known bug).
Your changes will likely work fine on Qt6 and all platforms (but I haven’t checked).

1 Like

Hi @shlop_op thanks for working on this.

Are you aware of the “add icon feature” in the Krita 5.3 workflow button addition? Maybe you can get inspiration from it.

It mainly allows a user to:

  • make his own icon png
  • store it on the disk
  • then link the button to that png

As a result Krita shows the icon on the button instead of the action’s text description.

The below thread is mainly about the workflow button feature, but the icon topic is mentioned in it as well:

Feedback for the function:

EDIT:

I am not sure, but I think the “worflow button” function is Python, so it might not be available in Android.