GNOME Bugzilla – Bug 682123
"changes throughout the day" icon is extremely small
Last modified: 2013-04-19 09:14:19 UTC
The "changes throughout the day" icon is extremely small now.
Created attachment 222036 [details] screenshot
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?
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.
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 ?
Created attachment 223910 [details] [review] Set pixbuf renderer stock size to 32 so emblems render at 16px
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 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