Ticket #2378 (new task)

Opened 3 years ago

Last modified 15 months ago

Drop data/pixmaps data/iconsets and use icon themes

Reported by: patrys@… Owned by: Jim++
Priority: normal Milestone:
Component: None Version:
Severity: normal Keywords: icontheme xdg
Cc: Blocked By:
OS: All Blocking:

Description

Since gajim does not even use the proper directory for pixmaps, I'd like to request moving to themes.

Both GTK/GNOME and KDE make use of /usr/share/icons and there is a special folder called hicolor. hicolor is the default fallback dir if an icon could not be found elsewhere and that's where applications should drop their stock icons (/usr/share/icons/hicolor/XxY/apps/). All icons should be prefixed with application's name (ie. gajim.png, gajim-error.svg, etc.).

If you want to keep some stuff unthemable, things like the about image should be moved to /usr/share/pixmaps/gajim.

  1. It would make gajim easily themable with the rest of the desktop
  2. Accessing standard icons is easier as you don't have to know the size, extension or format (which means less code as GTK takes care of that, you only specify the desired size and GTK picks the best match)
  3. You don't care which theme is currently in use so you don't have to add another way to pick the right iconset in the UI
  4. Could also be done on Windows as GTK provides these directories as well

I'd also like to see the roster icons to be a part of the theme (like in Nautilus you don't have to provide your own iconset for folders and files). Desktop integrations is the main reason I choose Gajim over Psi.

Attachments

gajim-icontheme.patch (15.3 kB) - added by Patryk Zawadzki <patrys@…> 3 years ago.
first patch to use native gtk icon themes
gajim-icontheme2.patch (16.3 kB) - added by jim++ 3 years ago.
Same patch with fixs

Change History

Changed 3 years ago by nk

I just want to add, that as much as users like desktop intergrations, it's

also a very hard part for devs to do and I should know.. :$ :)

Changed 3 years ago by nk

  • type changed from enhancement to task

Changed 3 years ago by anonymous

[12:00:41 AM] nkour: see, http://pygtk.org/docs/pygtk/class-

gtkiconfactory.html [12:00:54 AM] nkour: this holds iconsets which holds iconnames

Changed 3 years ago by anonymous

http://pygtk.org/docs/pygtk/class-gtkiconsource.html which is wrapped in

iconset which is wrapped in iconfactory, provides the ability to use SVG and ignore sizes

Changed 3 years ago by patrys@…

Attaching the preliminary patch (currently against 20061027 snapshot).

To make it work:

Move all icons from pixmaps folder to /usr/share/icons/hicolor/*size*/apps/ and prefix them with "gajim-"

For example data/pixmaps/kbd_input.png becomes /usr/share/icons/hicolor/16x16/gajim-kbd_input.png

Then invoke:

gtk-update-icon-cache -f /usr/share/icons/hicolor/

to update the icon cache.

Changed 3 years ago by Patryk Zawadzki <patrys@…>

first patch to use native gtk icon themes

Changed 3 years ago by jim++

Isn't it /usr/share/icons/hicolor/16x16/apps/gajim-kbd_input.png ?

Changed 3 years ago by patrys@…

Yes it is. My bad.

Changed 3 years ago by asterix

it could be fine that if it doen't find icon in /usr/share/... it default to gajim actual pixmap folder. in this case we can use gajim without having to do make install

Changed 3 years ago by patrys@…

It's as easy as modifying the gtkgui_helpers.get_icon_* to print a warning that it is using a fallback and actually return the local file.

Still current pixmap directory structure should be modified to use something like 16x16/gajim-kbd_input.png

Changed 3 years ago by jim++

Same patch with fixs

Changed 3 years ago by jim++

Same patch but against svn. Correct two typo ('kbd_input.png' -> 'gajim-kbd_input', gtk_gui_helpers -> gtkgui_helpers) and correct calls from gajim.py to notify.popup().

I just saw some '.png' that shouldn't be there also.

Works fine with the icons I tested.

Changed 3 years ago by jim++

patrys, where will be the iconsets then ? They will not be ALL in the same folder with no subfolder I hope.

Changed 3 years ago by patrys@…

It does not touch the iconsets at all.

I am planning to do a second patch that moves the default iconset and transport icons to the icontheme and allows it to remain themeable (like gajim-tango can provide a tango specific icons) while still allowing an override with a local iconset (as most current iconsets are not targetted at any particular theme).

Changed 3 years ago by asterix

to sum up for this ticket:

  • update patch so that it falls back to gajim folder (maybe change the structure, but I don't see wht having a 16x16 folder)
  • update destination for images in make install

Changed 3 years ago by patrys@…

A simple workaround could be to use icon_theme.set_search_path('data/pixmaps') and make sure the pixmaps are arranged correctly there.

Changed 3 years ago by patrys@…

Oops, I mean append_search_path

Changed 2 years ago by patrys

  • os set to All

Bump? Everything is here, any reason not to commit?

Changed 15 months ago by Jim++

  • keywords icontheme added
  • owner changed from asterix to Jim++
  • summary changed from Drop data/pixmaps and use icon themes to Drop data/pixmaps data/iconsets and use icon themes

As far as I understand for the moment, this patch only adds complexity to the data dir. As icons in data/pixmaps are not themable and always have the same size, using gtk.IconTheme? doesn't have any interest.

gtk.IconSet? and gtk.IconSource? MAY be more useful for that, but I don't understand how to use render_icon() yet. Someone knows ?

On the other hand, I began to work on using gtk.IconTheme? for data/iconsets . Here we have differents size and themes, so it is useful. We could drop some code where we deal with that and let gtk do it. But after firsts tests, it seems it is slow. I will test more and see if it worth the price or if iconset code only need some cleanups (see #3643).

Changed 15 months ago by Jim++

  • keywords xdg added

Add/Change #2378 (Drop data/pixmaps data/iconsets and use icon themes)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
Next status will be 'needinfo'
The owner will change to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.