translate / virtaal

Easy-to-use and powerful offline translation tool
https://virtaal.translatehouse.org
GNU General Public License v2.0
298 stars 58 forks source link

Provide png icons with different sizes for GUI menus + make icons more XDG compliant #1512

Open booxter opened 14 years ago

booxter commented 14 years ago

Currently, Virtaal uses single 48x48 one-size-fits-all .png icon for using in GUI menus (like GNOME or KDE). Since we already have other sizes in virtaal.ico file we should provide it to our users too. This can be achieved by creating share/icons/hicolor/x/apps directories and putting pngs with corresponding size there. This will improve look&feel on large and small screens (gtk+ will pick the right size automatically). Also it will make Virtaal more XDG Icon Spec compliant (by reflecting the needed /usr/share/icons/ directory hierarchy).

Also currently we install virtaal.ico in /usr/share/icons which possibly is better to place to /usr/share/pixmaps (though I haven't found any xdg standard for this it reflects my distro - gentoo - behaviour).

friedelwolff commented 14 years ago

Created attachment 657

Virtaal icons in various sizes

Here is the icon, in PNG files of various sizes. You can use this to test if things work the way you expect.

booxter commented 14 years ago

Created attachment 665

patch which adds icons of different sizes and makes virtaal more XDG-compliant

dwaynebailey commented 14 years ago

From: http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout

By default, apps should look in $HOME/.icons, /usr/share/icons and /usr/share/pixmaps (in that order)

So I don't think s/icons/pixmaps/ is correct. Adding the sizes for the app icon is a win though.

dwaynebailey commented 14 years ago

We might want to look at set_icon_list instead of set_icon_from_file, which might make it possible to simply drop our .ico file

http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--set-icon-list

booxter commented 14 years ago

Created attachment 666

new patch

changelog:

booxter commented 14 years ago

Created attachment 667

standard patch (not that svn crap)

dwaynebailey commented 14 years ago

(In reply to BZ-IMPORT::comment #5)

Created an attachment (id=666) [details] new patch

changelog:

  • use and install .ico only for win32, .png only for other platforms;

We don't seem to be installing the scalable directory which contains .svg (we can add virtaal.svg later)

  • leave *.ico files in share/icons/ directory;
  • use pyxdg module functions to determine the right icon file to load (additional dependency).

I was hoping that we could simply use the Pixmp function. For this to be really helpful we'd need to pass the theme to the lookup function, I'm not sure if this is possible though. I wonder if we can just rip the lookup code from pyxdg instead of creating a new dependency. Would that just be one file?

booxter commented 14 years ago

Created attachment 672

patch for virtaal-0.6.1

Use .ico files for Windows and .png files for other platforms. And don't mix them on the same system.

booxter commented 14 years ago

Created attachment 673

Patch for trunk

booxter commented 14 years ago

Someone should test these patches on Windows system before considering its commit.

friedelwolff commented 13 years ago

I know it is really late after the fact, but I finally looked into this. Windows is not that straight forward, unfortunately, and the proper xdg icon stuff isn't quite obvious to me either. I have two open categories of issues I still want to answer/fix:

It seems we don't need to set the application icon in Windows - I guess it gets it form the .exe file automatically. This doesn't work during development, but I'm willing to have it that way. I don't think we have anyone really using virtaal from checkout on windows.

The welcome screen looks as if it might be able to use the same method on Windows as we have for xdg, so I think we should consider it. We need to find a way of registering the directory with the icon theme search path so that it can find things. For some reason the virtaal icon is available, but nothing else.

The gtk.ICON_SIZE_BUTTON is smaller than the current 24x24 - was it correct for you? I need gtk.ICON_SIZE_LARGE_TOOLBAR on my system.

We can't use the current xdg stuff from a checkout, so we'll need to find a way of detecting that case and adding the necessary directory to the icon theme search path in the launcher or something like that. Several of us are testing permanently from SVN trunk without system wide installation, so I'm not sure it is ideal to to have this broken for everyone doing that.

I'm getting close to finalising stuff for 0.7, and this doesn't feel urgent, but if we can resolve these things, I'll be happy to put it in.