forked from AuroraMiddleware/gtk
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
This commit is contained in:
parent
b5d45a9edc
commit
77221c18a3
@ -2910,6 +2910,7 @@ construct_icon_info (GtkWidget *widget,
|
|||||||
priv->icons[icon_pos] = icon_info;
|
priv->icons[icon_pos] = icon_info;
|
||||||
|
|
||||||
icon_info->icon_helper = _gtk_icon_helper_new ();
|
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))
|
if (gtk_widget_get_realized (widget))
|
||||||
realize_icon_info (widget, icon_pos);
|
realize_icon_info (widget, icon_pos);
|
||||||
@ -7620,6 +7621,8 @@ gtk_entry_set_icon_from_pixbuf (GtkEntry *entry,
|
|||||||
if (pixbuf)
|
if (pixbuf)
|
||||||
{
|
{
|
||||||
_gtk_icon_helper_set_pixbuf (icon_info->icon_helper, 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)
|
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user