GNOME Bugzilla – Bug 170708
[PATCH] Make gweather more theme friendly and resizable
Last modified: 2010-01-24 01:06:08 UTC
Gweather is not very resizable in the sense that making the panel bigger will always give you the 16x16 icon. The following patch looks up an icon from the icon theme every time the panel size changes (and thus becomes much more theme friendly for natively-sized icons). It also cleans up a couple other icon usage points to use the icon theme better. It will try to fit the text first and then choose an icon of the remaining size allocated to it. If it can't fit at least a 16x16 icon, it will put the text to the side (or below it if vertical). It also recalculates layout on an update because if the number of characters changes, from say 0 to 10 degree celsius, then on a vertical panel, things screw up. This is a problem that existed before. This patch has the side effect of actually not showing the 16x16 version very much, since the panel is rarely sized that small.
Created attachment 38861 [details] [review] Proposed patch
This should be reviewed.
This is not material for 2.12.1. Punting to 2.13.
This patch will have bitrotten with the addition of libgweather and could do with updating. Out of interest, do we have any icons besides the 48px and the 16px available?
*** Bug 138181 has been marked as a duplicate of this bug. ***
Created attachment 58193 [details] [review] Updated patch Here ya go. This is against current CVS. I'm pretty sure it still works fine, but the rest of my CVS GNOME install is b0rked, so it's hard to tell.
Oh, and no, just the 16 and 48 pixel versions are installed with gnome-icon-theme.
I just was pointed to this bug and I think it has some problems. The reason for this: I'm running a 60px wide vertical panel. With your patch I think I would get a pretty huge image next to the temperature label, which would waste a lot of precious vertical space. I'd have tried the patch, but it's pretty outdated again. In the other applets I've been fixing to work with my 60px vertical layout, I've tried to make sure that - the image never exceeds GTK_ICON_SIZE_SMALL_TOOLBAR, because excessively huge icons tend to catch the view of the eye - images that aren't too small never increase the size of the applet, because panel space is a pretty limited resource most of the time. So in this case I'd probably make sure that the image: 1) has a good minimum size (not sure if that should be 16 px or better a GtkIconSize like GTK_ICON_SIZE_SMALL_TOOLBAR to make it nicer for large themes) 2) has a good maximum size (I've used GTK_ICON_SIZE_LARGE_TOOLBAR) 3) is positioned so that it makes the weather applet as small as possible 4) has a size that does not exceed the text width/height (depending on positioning)
it occurred to me that the icon caching in libgweather is pretty pointless (only a handful of icons, and they are only requested infrequently). So here is a patch which does 2 things: - it adds a weather_info_get_icon_name() api which will let apps just set the icon by name, and have all theme and size changes be taken care of automatically - removes the icon caching, and reimplementes weather_info_get_pixbuf on top of the new function
Created attachment 97573 [details] [review] libgweather patch
Created attachment 97580 [details] [review] gweather patch
All this has landed by now.