This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Icon-less actions on toolbars

Tags: None
(comma "," separated)
User avatar
Storm
Registered Member
Posts
77
Karma
0
OS

Icon-less actions on toolbars

Fri Sep 15, 2017 10:12 pm
I added several useful things to my toolbar but many have no icons, instead display as a button with - often lenghty - text on it.


First of all, I want to have a placeholder for now so I don't have text buttons like "Turns on warnings for colors out of proofed gamut gamut, needs soft proofing to be turned on." :P Can I do this manually? Or can we add a build flag or something?


Second, I would like to suggest the ability to toggle if a button displays as text or image - if it has no icon, text is preselected, if it has, icon is preselected. If icon is chosen and it has none a placeholder would be used.


Third, I would like to contribute by creating icons for some of these actions, at least for the ones I want to use such as show/lock guides, show assistants/previews, soft proofing, gamut warnings, etc.

How can I do this? First I would need guidelines about how to create an acceptable icon, and then let me know how can I submit them. Note: I don't know C or Python so if adding them requires programming I can't do that, but I can use git to submit the icons themselves if that is better for you.


"Sic itur ad astra per aspera."
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Icon-less actions on toolbars

Sat Sep 16, 2017 7:54 am
Check this file: https://phabricator.kde.org/source/krit ... ita.action . Every action is defined here, and if the icon entry is empty, there isn't an icon yet. New icons should fit in with the existing design, which is mostly based on KDE's breeze icons: https://community.kde.org/KDE_Visual_De ... IconDesign
User avatar
Storm
Registered Member
Posts
77
Karma
0
OS

Re: Icon-less actions on toolbars

Sat Sep 16, 2017 1:28 pm
Thank you! I'm looking into it. now, but I have a few more questions:


1; SVG preferred over PNG right?


2; Where should icons go exactly? I looked in krita/pics but I got lost.


3; May I also suggest some text changes by editing krita/krita.action? For example, short text for the buttons (I think it's enough if the tooltip is detailed.)

In order to do this I would also like to understand exactly what string is used for what because there are several. Example:
Code: Select all
      <text>Brush Smoothing: Disabled</text>
      <whatsThis></whatsThis>
      <toolTip>Brush Smoothing: Disabled</toolTip>
      <iconText>Brush Smoothing: Disabled</iconText>


"Sic itur ad astra per aspera."
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Icon-less actions on toolbars

Sat Sep 16, 2017 1:46 pm
* Yes, icons need be in SVG format
* The locations for icons are a _mess_, because Krita used to be part of calligra. So generic icons are in pics, krita-specific icons in krita/pics.
* Yes, changing some texts is possible.
** "Text" is what is shown in e..g the shortcut editor
** "iconText" is what is shown in e.g. the toolbar if there is no icon, or icon + text is enabled (not sure whether that's even possible still, but the code has provision for that)
** ToolTip is what is shown when hovering over a button
** whatThis is what is shown or when clicking on the help icon in the titlebar, then clicking on the button.
** statusTip is what is shown in the statusbar when selecting a certain action
User avatar
scottpetrovic
Registered Member
Posts
520
Karma
4
OS

Re: Icon-less actions on toolbars

Sat Sep 16, 2017 2:08 pm
SVGs are what we try to use now as they are easier to edit and tweak.

The SVG files aren't loaded directly. They are in the source directory, but they all end up getting added to QRC files. This is the step I did when adding some icons recently (today)

1. make a copy of an existing svg icon (I went into src > krita > pics > misc-dark
2. make a light and dark version of the icon in something like Inkscape
3. the prefix "light_" and "dark_" need to be there for the file name. You can see the existing ones for reference
4. The SVG files also need to go in the QRC file (misc-dark folder and misc-light folder). I use QtCreator to get them in there. This is what Krita actually reads
5. For actually making an action use the icon, go into src > krita > krita.action. There will be an <icon> entry that you will put your icon name.
6. For what to put into the icon entry, put the file name that you made without the "light_" and "dark_" in it

That is pretty much it. If you know how to compile krita, you can actually test it out.
User avatar
Storm
Registered Member
Posts
77
Karma
0
OS

Re: Icon-less actions on toolbars

Sat Sep 16, 2017 3:53 pm
Thanks for the info Boud and Scott!

scottpetrovic wrote:4. The SVG files also need to go in the QRC file (misc-dark folder and misc-light folder). I use QtCreator to get them in there. This is what Krita actually reads

Could you please elaborate on this a little? My programming knowledge ends at PHP, I never touched C or Qt and never used an interface like QtCreator before.


"Sic itur ad astra per aspera."
User avatar
scottpetrovic
Registered Member
Posts
520
Karma
4
OS

Re: Icon-less actions on toolbars

Sat Sep 16, 2017 4:09 pm
It might be easier if you just share the icons on here with what you have done and maybe talk with us in out chat room if we miss it here . It might be a bit of work for you do everything that we usually do


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]