summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Lemos <fernandotcl@gmail.com>2012-05-15 14:28:37 (GMT)
committerCosimo Cecchi <cosimoc@gnome.org>2012-05-17 19:17:55 (GMT)
commite694bd75f601d4796119b622ba2f2cd13ca86ddd (patch)
treeefbbb2d669220dfe5b82963946c7cd2f8b3561cf
parent2e51d827dea12201b4edca10abf160b31db0206a (diff)
downloadgtk+-e694bd75f601d4796119b622ba2f2cd13ca86ddd.zip
gtk+-e694bd75f601d4796119b622ba2f2cd13ca86ddd.tar.xz
statusicon: use absolute delta to find the nearest icon size
Otherwise, if we only look at (pixel_size - stock_size), we miss the case when the pixel size is smaller than any provided stock size. https://bugzilla.gnome.org/show_bug.cgi?id=673749
-rw-r--r--gtk/gtkstatusicon.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c
index 8bcb638..efecdad 100644
--- a/gtk/gtkstatusicon.c
+++ b/gtk/gtkstatusicon.c
@@ -1328,10 +1328,9 @@ round_pixel_size (GtkWidget *widget,
for (s = GTK_ICON_SIZE_MENU; s <= GTK_ICON_SIZE_DIALOG; s++)
{
- if (gtk_icon_size_lookup_for_settings (settings, s, &w, &h) &&
- w <= pixel_size && h <= pixel_size)
+ if (gtk_icon_size_lookup_for_settings (settings, s, &w, &h))
{
- d = MAX (pixel_size - w, pixel_size - h);
+ d = MAX (abs (pixel_size - w), abs (pixel_size - h));
if (d < dist)
{
dist = d;