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 170708 - [PATCH] Make gweather more theme friendly and resizable
[PATCH] Make gweather more theme friendly and resizable
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: gweather
git master
Other Linux
: Normal minor
: 2.14
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
: 138181 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-03-17 18:46 UTC by Michael Terry
Modified: 2010-01-24 01:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Proposed patch (12.58 KB, patch)
2005-03-17 18:46 UTC, Michael Terry
needs-work Details | Review
Updated patch (12.95 KB, patch)
2006-01-27 04:28 UTC, Michael Terry
needs-work Details | Review
libgweather patch (4.00 KB, patch)
2007-10-21 17:59 UTC, Matthias Clasen
none Details | Review
gweather patch (5.89 KB, patch)
2007-10-21 20:12 UTC, Matthias Clasen
none Details | Review

Description Michael Terry 2005-03-17 18:46:13 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.
Comment 1 Michael Terry 2005-03-17 18:46:59 UTC
Created attachment 38861 [details] [review]
Proposed patch
Comment 2 Danielle Madeley 2005-08-03 18:22:21 UTC
This should be reviewed.
Comment 3 Danielle Madeley 2005-10-03 02:23:51 UTC
This is not material for 2.12.1. Punting to 2.13.
Comment 4 Danielle Madeley 2006-01-06 03:41:46 UTC
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?
Comment 5 Danielle Madeley 2006-01-11 04:51:03 UTC
*** Bug 138181 has been marked as a duplicate of this bug. ***
Comment 6 Michael Terry 2006-01-27 04:28:00 UTC
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.
Comment 7 Michael Terry 2006-01-27 04:29:04 UTC
Oh, and no, just the 16 and 48 pixel versions are installed with gnome-icon-theme.
Comment 8 Benjamin Otte (Company) 2006-07-23 19:04:53 UTC
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)
Comment 9 Matthias Clasen 2007-10-21 17:57:43 UTC
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

Comment 10 Matthias Clasen 2007-10-21 17:59:16 UTC
Created attachment 97573 [details] [review]
libgweather patch
Comment 11 Matthias Clasen 2007-10-21 20:12:30 UTC
Created attachment 97580 [details] [review]
gweather patch
Comment 12 Matthias Clasen 2008-08-16 22:15:59 UTC
All this has landed by now.