Restore the (search) entry focus after changing the icon
This commit is contained in:
parent
90f04fea52
commit
1662a03677
1 changed files with 8 additions and 2 deletions
|
@ -27,10 +27,16 @@ gtk_icon_entry_set_icon_from_pixbuf (GtkEntry* entry,
|
||||||
GtkEntryIconPosition position,
|
GtkEntryIconPosition position,
|
||||||
GdkPixbuf* pixbuf)
|
GdkPixbuf* pixbuf)
|
||||||
{
|
{
|
||||||
|
GtkWidget* widget = GTK_WIDGET (entry);
|
||||||
|
GtkWidget* window;
|
||||||
|
|
||||||
/* Without this ugly hack pixbuf icons don't work */
|
/* Without this ugly hack pixbuf icons don't work */
|
||||||
gtk_widget_hide (GTK_WIDGET (entry));
|
gtk_widget_hide (widget);
|
||||||
gtk_entry_set_icon_from_pixbuf (entry, position, pixbuf);
|
gtk_entry_set_icon_from_pixbuf (entry, position, pixbuf);
|
||||||
gtk_widget_show (GTK_WIDGET (entry));
|
gtk_widget_show (widget);
|
||||||
|
|
||||||
|
if ((window = gtk_widget_get_toplevel (widget)))
|
||||||
|
gtk_window_set_focus (GTK_WINDOW (window), widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue