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 682123 - "changes throughout the day" icon is extremely small
"changes throughout the day" icon is extremely small
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Background
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-17 22:11 UTC by William Jon McCann
Modified: 2013-04-19 09:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (467.68 KB, image/png)
2012-08-21 15:32 UTC, William Jon McCann
  Details
Set pixbuf renderer stock size to 32 so emblems render at 16px (1.24 KB, patch)
2012-09-10 13:42 UTC, William Jon McCann
committed Details | Review

Description William Jon McCann 2012-08-17 22:11:23 UTC
The "changes throughout the day" icon is extremely small now.
Comment 1 William Jon McCann 2012-08-21 15:32:09 UTC
Created attachment 222036 [details]
screenshot
Comment 2 William Jon McCann 2012-08-21 23:51:52 UTC
Ok, here's what seems to be happening.

 * We create an icon for the wallpaper about 256px wide
 * When applicable, we apply an GEmblem on named "slideshow-emblem"
 * We display these in an GtkIconView by setting the "gicon" property of GtkCellRendererPixbuf
 * The GtkCellRendererPixbuf has "stock-size" default to 1
 * settings "gicon" on GtkCellRendererPixbuf does:
     _gtk_icon_helper_set_gicon (priv->icon_helper, g_value_get_object (value), priv->icon_size);
 * When the GtkCellRendererPixbuf is asked to render it calls _gtk_icon_helper_draw
 * Which then calls:
     pixbuf = _gtk_icon_helper_ensure_pixbuf (self, context);
 * Which calls:
     ensure_pixbuf_for_icon_name_or_gicon (self, context);
 * Which calls:
     ensure_icon_size (self, context, &width, &height);
 * Which calls:
     gtk_icon_size_lookup_for_settings (settings,
					self->priv->icon_size,
					&width, &height)
 * Which yields width=16 and height=16 for icon_size == 1 and returns that to ensure_pixbuf_for_icon_name_or_gicon
 * Which calls:
      info = gtk_icon_theme_lookup_by_gicon (icon_theme,
                                             self->priv->gicon,
                                             MIN (width, height), flags);
 * Which for a G_IS_EMBLEMED_ICON tries to load all the emblems like so (where size == 16):
              emblem_info = gtk_icon_theme_lookup_by_gicon (icon_theme, emblem, size / 2, flags | GTK_ICON_LOOKUP_FORCE_SIZE);
 * This attempts to load an emblem at size 8px
 * Those emblems are then composited onto the base image

There are a number of problems here.

 1. The API contract is not explicit that stock-size is honored for anything but stock-id.
 2. I'm not sure emblems should never be rendered at less than 16px
 3. Symbolic style icons should be rendered at 16px
 4. The emblem used here is not detected as symbolic
 5. I don't think the " / 2" is correct even if the caller had set the stock-size property differently. I would expect that if there are larger images then the focus should be on the images and not scale the emblems to half the image size.
 6. It isn't clear what stock-size is appropriate for when high resolution images are used. GTK_ICON_SIZE_INVALID?
Comment 3 William Jon McCann 2012-08-21 23:55:14 UTC
And the reason this behavior changed recently is that the old icon view had this set in .ui:
                    <property name="stock_size">6</property>

presumably because GTK_ICON_SIZE_DIALOG is the largest GtkIconSize.
Comment 4 Matthias Clasen 2012-08-22 02:14:22 UTC
The emblem stuff is clearly designed with regular icons, not huge thumbnails, in mind.

For your immediate problem, I guess you could simply set the pixel size to a suitable value, like 32 ?
Comment 5 William Jon McCann 2012-09-10 13:42:54 UTC
Created attachment 223910 [details] [review]
Set pixbuf renderer stock size to 32 so emblems render at 16px
Comment 6 Bastien Nocera 2012-09-10 13:44:42 UTC
Review of attachment 223910 [details] [review]:

Good work-around.

::: panels/background/cc-background-chooser-dialog.c
@@ +270,3 @@
   renderer = gtk_cell_renderer_pixbuf_new ();
+  /* set stock size to 32px so that emblems render at 16px. see:
+   * https://bugzilla.gnome.org/show_bug.cgi?id=682123

Want to link directly to the comment instead?
Comment 7 William Jon McCann 2012-09-10 13:48:50 UTC
Comment on attachment 223910 [details] [review]
Set pixbuf renderer stock size to 32 so emblems render at 16px

Attachment 223910 [details] pushed as 312a5df - Set pixbuf renderer stock size to 32 so emblems render at 16px