After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759105 - Patch to add icon theme selection
Patch to add icon theme selection
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Urgent normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
: 743269 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-12-07 00:15 UTC by Ben
Modified: 2015-12-14 17:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patches, icons, screenshot, icon theme. (727.62 KB, application/zip)
2015-12-07 00:15 UTC, Ben
  Details
Patch for master to add icon theme support (53.16 KB, patch)
2015-12-07 13:39 UTC, Ben
none Details | Review
Patch for master to add custom icon theme support (54.81 KB, patch)
2015-12-08 20:04 UTC, Ben
none Details | Review
Unfinished changed patch (46.78 KB, patch)
2015-12-08 23:32 UTC, Michael Natterer
committed Details | Review
screenshot ubuntu unfinished patch (135.06 KB, image/png)
2015-12-09 00:20 UTC, Ben
  Details
screenshot prefs ubuntu unfinished patch (101.31 KB, image/png)
2015-12-09 00:21 UTC, Ben
  Details
Desaturated icons (325.98 KB, application/x-compressed-tar)
2015-12-09 11:59 UTC, Michael Natterer
  Details
Screenshot with Barbara/Jakub/jEsuSda icons. (120.48 KB, image/png)
2015-12-09 18:43 UTC, Jehan
  Details
Adds missing icon for size 48 (4.25 KB, application/zip)
2015-12-11 11:58 UTC, Ben
  Details
Alternate (Color) Default Icon Theme icon (3.98 KB, application/zip)
2015-12-11 16:17 UTC, Ben
  Details
Proposed Icon Theme icon for the 'Symbolic' theme (5.23 KB, application/zip)
2015-12-11 16:19 UTC, Ben
  Details
Symbolic vector icons (5.23 KB, application/zip)
2015-12-13 14:22 UTC, Ben
  Details
the missing svg icons for symbolic theme (13.62 KB, application/zip)
2015-12-13 14:33 UTC, Ben
  Details

Description Ben 2015-12-07 00:15:29 UTC
Created attachment 316858 [details]
patches, icons, screenshot, icon theme.

Create two sets of patches on for the master branch and one for gtk3-port branch to enable icon theme support in a similar fashion as current themes are supported. 

Incuding the test icon theme, place holder icons for the pref menu and 3 patches (0001 is for master, and 0003 & 0004 are for gtk3-port) and a screenshot of what it looks like running on 2.9.3.

The patch will create an icons in the users home directory where icon themes can be added. For example in 2.9.2/3 in linux a  user would have '/home/someuser/.config/GIMP/2.9/icons' where they can add their icon themes.
Comment 1 Michael Natterer 2015-12-07 07:19:35 UTC
Holy shit :) Thanks, will look into this ASAP.
Comment 2 Ben 2015-12-07 10:13:01 UTC
Welcome, the only caveat is that you need to restart the app for the changes to take effect. I haven't figured out how to force a reset for the whole app so it can redraw all the icons.
Comment 3 Michael Natterer 2015-12-07 12:23:19 UTC
That patch looks very good. I have to look into how we set the icon theme,
but that's about the only thing I have to look into :)

Could you turn the patches in the zip into one patch and attach it
separately please? The patches contain .orig and .rej files, and
some parts of the various patches are redundant.

I better let you clean up that before I mess with something...
Comment 4 Ben 2015-12-07 12:29:08 UTC
Sorry for that i thought i'd taken all those out. Then again i was getting tired at the end of yesterday lol. Looks like i missed a few, I'll see about cleaning them out. 

Also not sure if you want to keep the icon i made, if you have anyone that can do better best to replace it in that case :) It was something i threw together real quick.
Comment 5 Ben 2015-12-07 12:29:35 UTC
Just to confirm one patch for each branch right?
Comment 6 Michael Natterer 2015-12-07 12:36:05 UTC
We don't need a patch for gtk3-port because I will rebase it on top
of master after applying your patch to master.
Comment 7 Ben 2015-12-07 12:44:01 UTC
there is a minor difference between each, that's why i was asking.  I'll resubmit only the master branch then.
Comment 8 Ben 2015-12-07 13:39:11 UTC
Created attachment 316878 [details] [review]
Patch for master to add icon theme support
Comment 9 Michael Natterer 2015-12-07 18:48:21 UTC
Thanks! I guess I will see the conflict when rebasing gtk3-port and hopefully
resolve it :)
Comment 10 Michael Natterer 2015-12-07 22:54:24 UTC
Ok it seems I have some open questions.

Why create an own icon theme at all and not simply set the search
pathcof the default icon theme.

Apparently I haven't looked into how switching icon themes works,
particularly how to get a consistent look across all (default *and*
GIMP icons). Have you looked into this and can help me out?

Shouldn't we move the "hicolor" folder into a "Default" subdirectory
and simply switch between these subdirectories when we change themes?
It's all falling back to "hicolor" and al icon themes should inherit from
it.
Comment 11 Michael Natterer 2015-12-07 23:22:56 UTC
Also, where does that "greycolor" icon theme come from? It doesn't seem
to inherit from hicolor, so how are we going to find all the icons
that are not provided by it?
Comment 12 Ben 2015-12-07 23:35:49 UTC
Oh no disregard that i was testing just to make sure i would notice the change, so yeah you're right it sucks for that. 

Mind you i did try that earlier today on my linux box by setting inheritance to either hicolor, Hicolor, gnome, and default. Sadly that didn't change much but i think it is because i am setting a new icon theme and not using the default one and losing those paths it contain. I believe adding them in will resolve that but i still need to fix the code for. 

Spent to much time this PM trying to figure out how to force a redraw of the icon/widgets when doing the change. 

Will look at this path thing now instead.
Comment 13 Ben 2015-12-07 23:39:23 UTC
As to why use them at? Not sure why you guys switched to that, guess it should have made things easier at some future date.

As to why i did, well i spent a week trying to use the official methods in Linux to override it and none of them were working to my satisfaction hence why came up with the patch.

As to the why change them for a user, that's easy to change the look to something more compatible with whatever the user is comfortable with, for example i have a set that i am working on a set that replaces the gimp ones with ones with some that are similar to Photoshop. Actually i think that's the one i used in the screenshot actually instead of what i submitted with the patch. 

Not sure for other OS's but under Linux i would have had to set it globally and then have had to inherit whatever default one i preferred. For some reason on my setup (currently Ubuntu 15.10) that still didn't work out at all. 

Yes if you are going to override the default theme then you're going to have to deal with overrides for the gtk stock ones as well to stay consistent but that would be up to the theme maintainer to fix.

Right, as to the paths i did look into a bit of this earlier today because right now the patch only looks for two paths either the default gimp or the user one and may me sacrificing whatever was default. I am looking to figure out how to get the default one and add them back in appended after either of those two cases get used (gimp and user directory). When i submitted it for some reason it was working fine for both gimp and stock gtk icons (which was a fluke i think) using my current theme for the default gtk stuff. Started showing the basic default ones. So as i say i think something is getting lost and i think find the original defaults and adding them in should fix that. 

When you say move into a default subdirectory not sure what you mean, but for the paths its like i said in the paragraph above. 

Feeling rusty with this gtk stuff lol, last time i did any serious work with it gtk 1.2 was still it 'ish :)

(hmm for some reason this didn't get posted before that last one, trying again).
Comment 14 Michael Natterer 2015-12-07 23:52:27 UTC
What I meant was not "why use a custom icon theme at all" but why not
stick with gtk_icon_theme_get_default() and configure its path to
include the GIMP icon theme. That's what we do now and it works fine,
so simply switching between GIMP icon theme folders, each containing
a default "hicolor" hierarchy and index file should work fine, an would
make the patch much smaller and less intrusive.
Comment 15 Michael Natterer 2015-12-07 23:54:26 UTC
BTW, to properly notify all widgets of icon changes, it's probably
enough to emit "notify::icon-theme" on the GtkSettings object, but I
haven't verified that.
Comment 16 Ben 2015-12-08 00:03:34 UTC
Because with get default you can't use a custom theme. 

It gets flagged as private and you cannot do anything else with it. I went and looked at how gtk were doing it in code to figure it out. If you use get default for icon theme and then try to set a custom one mostly only the gtk icons get overriden but all the stock ones that get registered in gimpstock.c get stuck with the originally defined theme. 

When i tested with the grey color theme i posted here i would get some grey ones in prefs and everywhere else was the default colored ones when doing it the original way it was. Took me 3 days pouring over gtk lib code and testing it to even get this much :) 

Thanks for the heads up on that gtksettings will look at that again.
Comment 17 Ben 2015-12-08 00:08:52 UTC
from https://developer.gnome.org/gtk2/stable/GtkIconTheme.html#gtk-icon-theme-set-custom-theme

gtk_icon_theme_set_custom_theme ()

Sets the name of the icon theme that the GtkIconTheme object uses overriding system configuration. This function cannot be called on the icon theme objects returned from gtk_icon_theme_get_default() and gtk_icon_theme_get_for_screen().
Comment 18 Ben 2015-12-08 00:10:39 UTC
So far this is the only way to use your theme and still be able to set custom ones. If someone else can show me another easier way i'll be glad to switch to it :)
Comment 19 Ben 2015-12-08 03:58:30 UTC
I've fixed the path issue inheritance now works again, and when using the default theme it no longer tries to load Hicolor as a custom theme. Almost have it working when reloading the new icon theme. Hoping to have a new patch tomorrow.
Comment 20 Michael Natterer 2015-12-08 07:16:21 UTC
That sounds like me digging in GTK+ when first porting to icon themes...
Good luck, looking forward to the patch :)
Comment 21 tobias 2015-12-08 13:06:15 UTC
Just a note. If this is fixed we can have a look at this bugs:

Add HiDPI icon theme for gimp-2.9 (gtk2)
https://bugzilla.gnome.org/show_bug.cgi?id=725464

Provide a dark theme for GIMP
https://bugzilla.gnome.org/show_bug.cgi?id=757716

Migrating 2.8 theme to 2.9/2.10
https://bugzilla.gnome.org/show_bug.cgi?id=750105
Comment 22 Ben 2015-12-08 20:04:40 UTC
Created attachment 316978 [details] [review]
Patch for master to add custom icon theme support

Haven't added the code to redraw the window at this point because it only manages to redraw the app and not the prefs dialog window. No matter how i try to force it to redraw the icons stay with the original theme in prefs while they change everywhere else in the app. I may revisit this for the weekend or early next week. So for now i am only submitting the code to handle selection. Users will be greeted with a dialog to restart the app upon selection change. 

The patch now works as it originally did for the default theme, but for custom themes maintainers will either have to manually inherit or support all of icon items. As far i as i can tell its a limitation in gtk2 (i could be wrong lol but the documentation while concise for each function is rather obtuse on the whole). 

I have the base of the redraw patch (without multitudinous revs i've tried for for the prefs dialog) handy as a separate file should want that as well.
Comment 23 Michael Natterer 2015-12-08 20:20:22 UTC
Thanks a lot! Will look into this right away :)
Comment 24 Ben 2015-12-08 20:26:23 UTC
Welcome. I figure its safer not to have the redraw feature on selection change (for now) to avoid any unnecessary support questions at the onset. I may be slow to answer for a few days later this week, personal stuff to attend to (fyi) :)
Comment 25 Ben 2015-12-08 20:29:59 UTC
One question comes to mind if you are planning to support more than one official default theme? If so the code may require further changes at that time.
Comment 26 Michael Natterer 2015-12-08 23:30:10 UTC
We do plan to ship a flat theme with 2.10.
Comment 27 Michael Natterer 2015-12-08 23:32:46 UTC
Created attachment 316989 [details] [review]
Unfinished changed patch

I asked around on #gtk+ what would be the best way of changing icon
themes, and changed your patch to use the default theme and modify that.
All GTK+ widgets are listening to that theme, so live theme changing
works now. It however requires the themes to live in subdirectories
so they can all be called hicolor. It also simplifies the patch.
Comment 28 Ben 2015-12-08 23:42:52 UTC
I had something similar originally and it didn't work on my ubuntu box but i will try this and see what happens. As to the subdirectory where specifically would my theme reside? for example with my patch set it was checking the data dir for gimp and the user home data dir.
Comment 29 Ben 2015-12-09 00:20:33 UTC
Created attachment 316991 [details]
screenshot ubuntu unfinished patch
Comment 30 Ben 2015-12-09 00:21:02 UTC
Created attachment 316992 [details]
screenshot prefs ubuntu unfinished patch
Comment 31 Ben 2015-12-09 00:21:54 UTC
I ok it still finds my home folder, but this is what i get in ubuntu with your patch. Attaching screenshot-1.png

Also note that the prefs icons haven't changed automatically. But if close it and reopen prefs i now get screenshot-2.png.

I tried hicolor and Hicolor as the theme name, i get the same result no matter the name i give it.
Comment 32 Ben 2015-12-09 00:25:07 UTC
I did a fresh build from a fresh clone from the git repo i pulled from two hours ago, same thing.
Comment 33 Ben 2015-12-09 00:26:35 UTC
The only one working fine is the Default one.
Comment 34 Ben 2015-12-09 00:48:46 UTC
Just checked and am running with libgtk 2.24.28 for v2 and 3.16.7 for v3.
Comment 35 Michael Natterer 2015-12-09 07:13:22 UTC
You need to put your theme in an extra subfolder, so the
paths would be e.g.

~/.config/GIMP/2.9/icons/MyTheme/hicolor/16,32,...

Then you can choose between "Default" and "MyTheme". You never see
"hicolor" in prefs.

Prefs being broken in a problem in prefs, not with theme changing,
that will need some refactoring. All icons that use e.g. GtkImage
or GtkImageMenuItem do change live and work fine.
Comment 36 Ben 2015-12-09 09:58:47 UTC
It's 4am here time for coffee before my eyes roll in backwards and i shut down, lol, i spent 24 hrs trying to get that to work and it explains that (the prefs not changing), so much to learn about the codebase still i guess.

Just did a clean rebuild again to make sure. Sadly i still get the same issue with your suggested folder structure but it works with my patch. 

I looked at the patches from ubuntu for the lib they include and can't see any reason why it would be an issue, using my patch works with that folder structure so at this i would have to guess its maybe an issue with get default on linux.
Comment 37 Michael Natterer 2015-12-09 11:04:11 UTC
Hmm, that's odd. The word from the #gtk+ IRC channel was to definitely
use and modify the default icon theme. I suggest I push my modified patch,
fix prefs and then let's see what happens :)

Maybe I messed somewhere... will take care of this after work (in around
8 hours).
Comment 38 Ben 2015-12-09 11:08:07 UTC
Indeed, but was that for gtk2 or 3? For that matter are they still working or fixing gtk2?

I doubt that you messed up, because like i said i took a similar route originally and only after i got the same results did i research to tweak the code to override get default. 

Well have a good one then :)
Comment 39 Michael Natterer 2015-12-09 11:19:55 UTC
Just to be sure: where did you put your greycolor icon theme for
use with "unfinished patch"?
Comment 40 Ben 2015-12-09 11:24:00 UTC
/home/myuser/.config/GIMP/2.9/greycolor/hicolor/ and in there i have the various sized directories (12,16,22,etc...), the index.theme was in hicolor and i copied it over from the Default directory to make sure i hadn't messed it up previously.
Comment 41 Michael Natterer 2015-12-09 11:25:26 UTC
Try /home/myuser/.config/GIMP/2.9/icons/greycolor/hicolor/ before you
drop sleeping :) Should be 4:30 by now...
Comment 42 Ben 2015-12-09 11:29:29 UTC
sorry i mistyped i did have icons in there jut double checked it
Comment 43 Ben 2015-12-09 11:30:39 UTC
still feels like its 4:30 lol, but its two hours ahead now :D
Comment 44 Michael Natterer 2015-12-09 11:31:34 UTC
Argh, put it in $prefix/share/gimp/2.0/icons

I think I did mess with using the config folder, but that can be
fixed.
Comment 45 Michael Natterer 2015-12-09 11:35:07 UTC
No wait, it does work perfectly for me with the folder in
~/.config/GIMP/2.9/icons
Comment 46 Michael Natterer 2015-12-09 11:37:14 UTC
And the index.theme must still be in the hicolor folder...
Comment 47 Michael Natterer 2015-12-09 11:52:15 UTC
Pushed it during lunch break instead so others can try. Let's continue
from here.

commit 6762bf5b9be9eeb3a8f214647f1460152e227af1
Author: Benoit Touchette <draekko.sofware@gmail.com>
Date:   Tue Dec 8 14:52:12 2015 -0500

    Bug 759105 - Patch to add icon theme selection
    
    Add support for custom icon themes much like custom theme
    support. There is still work to be done but this is the
    basic functionality.

 app/config/gimpguiconfig.c         |  30 ++++++
 app/config/gimpguiconfig.h         |   2 +
 app/config/gimprc-blurbs.h         |   6 ++
 app/core/gimp-gui.c                |  12 +++
 app/core/gimp-gui.h                |   2 +
 app/core/gimp-user-install.c       |   1 +
 app/dialogs/preferences-dialog.c   | 112 ++++++++++++++++++++-
 app/gui/Makefile.am                |   2 +
 app/gui/gui-vtable.c               |   9 ++
 app/gui/gui.c                      |   3 +
 app/gui/icon-themes.c              | 261 ++++++++++++++++++++++++++++++++++++++++++++++++
 app/gui/icon-themes.h              |  34 +++++++
 app/widgets/gimphelp-ids.h         |   2 +
 icons/16/gimp-prefs-icon-theme.png | Bin 0 -> 492 bytes
 icons/16/gimp-prefs-icon-theme.svg | 196 ++++++++++++++++++++++++++++++++++++
 icons/22/gimp-prefs-icon-theme.png | Bin 0 -> 653 bytes
 icons/22/gimp-prefs-icon-theme.svg | 202 +++++++++++++++++++++++++++++++++++++
 icons/Makefile.am                  |  30 +++---
 libgimpwidgets/gimpstock.c         |   7 +-
 19 files changed, 895 insertions(+), 16 deletions(-)
Comment 48 Ben 2015-12-09 11:58:44 UTC
It works, i deleted all the original folders i had there and made a new one and it works now. Weird, it still looks like the same set of files but something must have been messed up in there originally. I tried it both ways in config and from share/gimp/2.0/icons with two sets of icon themes (i have another one i was working on) and both now work. Disregard my previous comment. Also i can confirm that you can put any name in the index.theme file, i guess having the folder structure set up that way overrides that or doesn't get used. Note to self start fresh when things get weird lol.

Will try the new commit in a bit.
Comment 49 Michael Natterer 2015-12-09 11:59:15 UTC
Created attachment 317014 [details]
Desaturated icons

This is your gray theme that works for me, index.theme from the
default theme just to be sure.
Comment 50 Michael Natterer 2015-12-09 12:03:01 UTC
Oh, didn't see you comment. Great :) Now for fixing the things that miss
the theme change...
Comment 51 Ben 2015-12-09 12:09:12 UTC
You'd think with all the tech support i've done over the years i'd have remembered to nuke my config folder and start over before now. *Rolls eyes* idjit :)

Doing make now, will let you know later today how it went, should work now :)

As for that other issue i'll try to find some time later today to start figuring that out. Unless you want some else to give it a go :)
Comment 52 tobias 2015-12-09 12:56:29 UTC
It looks like that the "gimp-prefs-icon-theme.svg" is licens as GPL 2.0:
"<cc:License         rdf:about="http://creativecommons.org/licenses/GPL/2.0/">"

As the SVGs are from Jakub Steiner it I think he should be asked to change the licence to GPL 3.0.
Comment 53 Ben 2015-12-09 13:12:27 UTC
It was from the gimp-prefs-themes.svg as a base for it, i guess there are probably a few more of them there like that. Probably worth double checking :)
Comment 54 Jehan 2015-12-09 14:33:32 UTC
That's awesome. I haven't read all in details in this long bug report, but I can see there is work on-going for finally making the long-awaited symbolic (light and dark) themes. Right?

Or is it work only on the platform itself and you are not working on the new symbolic icon theme itself?

> As the SVGs are from Jakub Steiner it I think he should be asked to change the licence to GPL 3.0.

Jakub Steiner and Barbara Muraus already agreed to relicense their work under GPLv3. Unfortunately we only have indirect message through Scl, but since Jakub is a GNOME member and very usual contributor, I have no doubt we can ask him to repeat as a public message himself (on the tracker, or a mailing list)…
See: https://mail.gnome.org/archives/gimp-developer-list/2013-November/msg00011.html

I'm not sure which icon set you are starting from, but another contributor (jEsuSdA) also started to work on some additional icons at some point.
See: 
https://mail.gnome.org/archives/gimp-developer-list/2013-October/msg00020.html

Anyway awesome work.
Comment 55 Ben 2015-12-09 16:31:36 UTC
Nope the icons in this bug report were just placeholders i used to test the patch with :)

@Micheal Took an hour and almost fixed the prefs icon theme issue, just need how to replace the pixbuf in the cell with images, there only seems to be a pixbuf cell render in gtk. The rest is working now. I'll tackle that later.
Comment 56 Jehan 2015-12-09 16:40:23 UTC
> Nope the icons in this bug report were just placeholders i used to test the patch with :)

Yep I realized this after I posted by checking the screenshots more carefully. :-)

I have actually started to have fun with your changes, and will push in a feature branch commits with all the icons from Jimmac (Jakub Steiner), Barbara Muraus and jEsuSdA. This should be available in an hour hopefully.
Comment 57 Michael Natterer 2015-12-09 17:47:58 UTC
Cool, but please don't replace the Default theme
just yet, please push to a new theme "Symbolic".
Comment 58 Jehan 2015-12-09 17:51:49 UTC
Of course, I was never planning to replace the default theme. And just in case we are not on the same page, I think we should keep the default theme as an alternative.

I don't mind if the symbolic theme becomes the new default in GIMP 2.10, but the old default should be kept around and selectable. :-)
Comment 59 Michael Natterer 2015-12-09 17:53:00 UTC
I agree with everything you said :)
Comment 60 Jehan 2015-12-09 18:31:42 UTC
Ok the symbolic icons are now available in branch "origin/symbolic".

I have only committed the icons from Jakub/Barabara/jEsuSda which were present in our current default icon theme (i.e. I did not include a whole bunch of icons from jEsuSda archive because they were not in our current set).

We are still missing a whole bunch of icons (or sizes). To get the full list of missing icons, run these commands in a terminal:

> cd icons/
> find default/ -name '*.png' |sort |sed s/^default// > default-icons
> find symbolic/ -name '*.png' |sort |sed s/^symbolic// > symbolic-icons
> diff default-icons symbolic-icons |grep '^<' | sed 's/^< /symbolic/'

As of today, this is 49 icons missing (I have not checked if the missing ones are all really used. I can just say they are missing compared to current default icon theme). That's some work for all designers who contribute to GIMP. :-)

Also note that I have not made a dark theme yet. This first commit just adds the icon theme.
I'll see later to add a new theme too. :-)
Comment 61 Jehan 2015-12-09 18:43:34 UTC
Created attachment 317064 [details]
Screenshot with Barbara/Jakub/jEsuSda icons.

Oh while I am at it, a small screenshot showing the current state. As we see, some icons are missing, but that's a good start. I have sent an email to gimp-gui mailing list hoping to get icon contributions.
Comment 62 Ben 2015-12-09 18:45:26 UTC
@Jehan if you want to save some time i had started something https://github.com/draekko/gimp-cc-themes everything in images are from someone else's theme and i hadn't replaced them yet, most of the ones in UI are mine but since they aren't needed anymore with the icon themes you could use the core to get you started for a dark theme.
Comment 63 Michael Natterer 2015-12-09 19:03:22 UTC
These "missing icon" icons make me think that we should always have
our complete default theme in the search path after the chosen theme,
so we at least have a fallback icon.
Comment 64 Jehan 2015-12-09 22:06:59 UTC
Pushed to master:

commit 5beb69d0096c28863fcf12f5e32cbb1ee6042480
Author: Jehan <jehan@girinstud.io>
Date:   Wed Dec 9 19:18:28 2015 +0100

    icons: new symbolic icon theme for GIMP.
    
    Images originally created by Jakub Steiner and Barbara Muraus as the
    "Art Libre" icon set.
    The contributor jEsuSdA later worked on it.
    It will now be available in the new icon theme selection through
    preferences.
    Many icons/size are still missing but this first commit makes a start
    for complementary work.


> @Jehan if you want to save some time i had started something

Thanks but I actually already had a working dark theme somewhere (that's not the hardest thing to do anyway starting from the Default theme!). The icon theme issue was the only one which I did not manage to have working, and I never made the time to dig in the code for this specific issue.

But you did it and you fixed it. Thanks for this, it's awesome. :-)
Comment 65 Ben 2015-12-09 22:15:09 UTC
Welcome, still need to fix the prefs dialog, trying to figure out how the cell render works, looking at adding one for images so that the prefs will also update quasi automagically on theme change.
Comment 66 Jehan 2015-12-09 22:53:20 UTC
> These "missing icon" icons make me think that we should always have
our complete default theme in the search path after the chosen theme,
so we at least have a fallback icon.

Fixed with:

commit 6fe8f75f5dc5870741cdcd54f82a242da864c58c
Author: Jehan <jehan@girinstud.io>
Date:   Wed Dec 9 23:46:58 2015 +0100

    app: prepend the selected icon theme path to the search path...
    
    ... instead of replacing the first path.
    This allows to fallback to our complete default theme icons when the
    selected icon theme has missing icons.
Comment 67 Jehan 2015-12-09 23:44:43 UTC
draekko > actually thinking about it, I'd be more than happy to delegate the work, and you obviously have more experience than me in theme making.

If you wish to propose us a working dark theme for GIMP master, you can upload a patch for this. :-)

Also do you know if there is a way for a theme to invert monochrome icons?

It would be fairly easy to create a dark version of our new symbolic icon set during compilation by inverting colors, but I wonder if this cannot be done on the theme side, dynamically. Then there would be no need to show 2 symbolic icon theme: the user selects the only Symbolic icon theme, simply when one loads the dark theme, we invert the colors.
Comment 68 Ben 2015-12-10 01:32:03 UTC
@Jehan Is there a time frame for this? As for inverting icon colors no sadly to my knowledge it can't be done without right code for it. Makes me wish gtk had a tint mode like Android does for its widgets since v5. Then you could set it in your properties like anything else. With that you could have a whole rainbow of icons lol.
Comment 69 Ben 2015-12-10 01:32:40 UTC
writing code i meant XD
Comment 70 Michael Natterer 2015-12-10 07:13:19 UTC
Jehan: had to revert your last patch, it let the search path grow
infinitely. I have a (more complicated) patch locally, but it's not
quite right yet, will push asap.
Comment 71 Jehan 2015-12-10 14:53:21 UTC
Mitch > no problem.

Draekko > there is no time frame. The sooner, the better. I have also asked on the gimp-gui@ mailing list if anyone was willing to contribute a dark theme. I guess the first contributed usable theme will be good (though it is not a race, and everyone should also collaborate to build together the best fit theme).
Comment 72 Ben 2015-12-11 11:16:06 UTC
@Jehan i'll try to find some time to make something :)
Comment 73 Ben 2015-12-11 11:58:36 UTC
Created attachment 317201 [details]
Adds missing icon for size 48
Comment 74 Ben 2015-12-11 12:14:57 UTC
@Jehan i get this when i switch to the symbolic icons "incorrect gamma=(0/100000)" fyi

@Micheal Just added a fix for support of icon themes in the prefs dialog.  https://bugzilla.gnome.org/show_bug.cgi?id=759345
Comment 75 Michael Natterer 2015-12-11 14:44:23 UTC
Comment on attachment 317201 [details]
Adds missing icon for size 48

Thanks for the icon, but I already noticed myself and added it :)
Comment 76 Ben 2015-12-11 14:47:28 UTC
All good, at the time i hadn't realized that one was needed for the notebook part of the prefs dialog :)
Comment 77 Jehan 2015-12-11 15:30:42 UTC
> i get this when i switch to the symbolic icons "incorrect gamma=(0/100000)"

As an error popup? In terminal output? Does the icon switching work otherwise (other than the missing icons)?
Because I have no such error.
Comment 78 Ben 2015-12-11 15:36:13 UTC
Linux Ubuntu 15.10, shows in terminal. When i run mogrify with the set it also isn't happy with them (was inverting/negating the colors to do tests on darker/lighter set). Don't have the exact output from mogrify right now.
Comment 79 Ben 2015-12-11 16:17:13 UTC
Created attachment 317220 [details]
Alternate (Color) Default Icon Theme icon

You might prefer this colored icon to the original one i made for the 'Default' theme.
Comment 80 Ben 2015-12-11 16:19:55 UTC
Created attachment 317221 [details]
Proposed Icon Theme icon for the 'Symbolic' theme

Proposing this as the icon for the 'icon theme' in the 'Symbolic' theme. Includes dark and light version.
Comment 81 Jehan 2015-12-11 16:39:28 UTC
Symbolic icon committed. We only need the light version. We will create the dark ones at build, this is easier and will make sure icons are consistent.

Don't you have a SVG as well for these though?
Comment 82 Ben 2015-12-11 16:54:03 UTC
@Jehan No i handcrafted them while having breakfast, i'll try to cook some up this weekend.
Comment 83 Michael Natterer 2015-12-12 18:37:07 UTC
This commit should complete the feature, app and plug-ins now use
the same theme, and the default theme is always used as a fallback
for missing icons:

commit 69f87bcc84304456b5305ff416b8bad5491e550d
Author: Michael Natterer <mitch@gimp.org>
Date:   Sat Dec 12 19:32:11 2015 +0100

    libgimpwidgets: be smarter when changing icon themes, and have fallbacks
    
    Add gimp_stock_set_icon_theme() which can be called at any time, also
    before gimp_stock_init(), in which case we avoid setting the configured
    icon theme twice on startup. Call it from libgimp/gimpui.c and
    from app/gui/icon-themes.c so the app and plug-ins use the same
    icon theme.

 app/gui/gui.c                  |   7 ++-
 app/gui/icon-themes.c          |  21 +-------
 libgimp/gimpui.c               |   5 ++
 libgimpwidgets/gimpstock.c     | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 libgimpwidgets/gimpstock.h     |   4 +-
 libgimpwidgets/gimpwidgets.def |   1 +
 6 files changed, 158 insertions(+), 28 deletions(-)
Comment 84 Michael Natterer 2015-12-12 23:56:58 UTC
Hmm, I'm just rebasing gtk3-port and the icon theme doesn't change...

You said there was a small difference in the patches, what exactly
was it?
Comment 85 Ben 2015-12-13 11:18:30 UTC
I think i had to call "gtk_style_context_reset_widgets(gdk_screen_get_default())" instead of calling "gtk_rc_reparse_all()" after setting a new icon theme in icons_theme_change_notify (icon-themes.c) to get the gtk3 version to switch over.
Comment 86 Michael Natterer 2015-12-13 12:46:00 UTC
Thanks, will try that after rebasing the next bunch of master changes...

It really looks almsost finished now, thanks again for getting this
started with a good patch! :)

And, you should really come to IRC where all the fun most discussions
happen...
Comment 87 Ben 2015-12-13 14:22:35 UTC
Created attachment 317302 [details]
Symbolic vector icons

SVGs for the symbolic icon set. Both light and dark.
Comment 88 Jehan 2015-12-13 14:28:50 UTC
I think you uploaded the wrong archive. It contains only the png images.

Also I already said it, but there is no need to duplicate your work twice. I think it really makes more sense to generate the inverted icons at build time (see bug 759384 where I already have a patch for this).
Comment 89 Ben 2015-12-13 14:32:14 UTC
@Jehan yeah re-uploading once more. I know but I like to be thorough, since i was in it and done i figured may as well get them out there (both light and dark), it'll be there for those times where you might need them in some distant future. ;)

@Micheal Glad i could help. I haven't used IRC since the very late 90s lol. Just had a flashback of getting usenet feed msg's from a fidonet bbs gateway from some guy running a unix box as a bbs locally. XD 

Where and what channel, i'll try to set some time aside for this. So much to do, not enough time :/
Comment 90 Ben 2015-12-13 14:33:31 UTC
Created attachment 317303 [details]
the missing svg icons for symbolic theme
Comment 91 Jehan 2015-12-13 14:49:34 UTC
Vectorial icons added:

commit 46b9c6927bbf68af3785910e48f365c5c32e4cb8
Author: Jehan <jehan@girinstud.io>
Date:   Sun Dec 13 15:44:03 2015 +0100

    icons: add vectorial icons by Benoit Touchette for prefs-icon-theme.


---------

As for the IRC channel, it's #gimp on irc.gimp.org.
Comment 92 Ben 2015-12-13 14:54:08 UTC
@Jehan thanks, time to find a decent chat program for linux.
Comment 93 Ben 2015-12-13 23:41:15 UTC
@Jehan you'd ask about controling icon colors, not sure you can from the theme side, not directly. I was in the gtk3 docs looking some info over and noticed they added gtk_icon_info_load_symbolic* functions which if i understand correctly does let you set the color for symbolic icons. 

https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-info-load-symbolic 

I'll try to take a look at this some time in the coming weeks to see what it actually does.
Comment 94 Jehan 2015-12-14 00:51:14 UTC
Yes for GIMP 2.10, I guess we will simply provide 2 versions of the icon theme (one being simply generated from the original one). For GIMP 3 though, we should definitely have proper symbolic icons changing colors automatically.

Since you are obviously planning to look into this, when you make a patch, could you please open a new ticket? The current one has been close and has already so many comments.
Thanks! :-)
Comment 95 Ben 2015-12-14 01:02:16 UTC
@Jehan Re: the patch that would have been my intent lol.
Comment 96 Jehan 2015-12-14 17:21:16 UTC
*** Bug 743269 has been marked as a duplicate of this bug. ***