[gtk+/composite-templates] Ensure pixbufs as entry icons get resized



commit fb5fdcbbd3c9ee8147ab5ffaec8fb0a625325c5a
Author: Carlos Garnacho <carlos lanedo com>
Date:   Fri Jul 13 15:55:44 2012 +0200

    Ensure pixbufs as entry icons get resized
    
    Entries don't expand vertically if they are given pixbufs larger
    than the calculated height for the current font, resulting in
    cropped icons, so force the pixbuf to be rescaled so it fits
    on the entry allocated size.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678087

 gtk/gtkentry.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index db83f05..335cb0f 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2910,6 +2910,7 @@ construct_icon_info (GtkWidget            *widget,
   priv->icons[icon_pos] = icon_info;
 
   icon_info->icon_helper = _gtk_icon_helper_new ();
+  _gtk_icon_helper_set_force_scale_pixbuf (icon_info->icon_helper, TRUE);
 
   if (gtk_widget_get_realized (widget))
     realize_icon_info (widget, icon_pos);
@@ -7620,6 +7621,8 @@ gtk_entry_set_icon_from_pixbuf (GtkEntry             *entry,
   if (pixbuf)
     {
       _gtk_icon_helper_set_pixbuf (icon_info->icon_helper, pixbuf);
+      _gtk_icon_helper_set_icon_size (icon_info->icon_helper,
+                                      GTK_ICON_SIZE_MENU);
 
       if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
         {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]