GdkPixbuf* pixbuf)
{
/* Without this ugly hack pixbuf icons don't work */
- if (pixbuf)
- {
- gtk_widget_hide (GTK_WIDGET (entry));
- gtk_entry_set_icon_from_pixbuf (entry, position, pixbuf);
- gtk_widget_show (GTK_WIDGET (entry));
- }
+ gtk_widget_hide (GTK_WIDGET (entry));
+ gtk_entry_set_icon_from_pixbuf (entry, position, pixbuf);
+ gtk_widget_show (GTK_WIDGET (entry));
+}
+
+void
+gtk_icon_entry_set_icon_from_stock (GtkEntry* entry,
+ GtkEntryIconPosition position,
+ const gchar* stock_id)
+{
+ if (stock_id)
+ gtk_entry_set_icon_from_stock(entry, position, stock_id);
+ else
+ gtk_icon_entry_set_icon_from_pixbuf(entry, position, NULL);
}
#else
{
GdkPixbuf *pixbuf;
+ /* FIXME: Due to a bug in GtkIconEntry we need to set a non-NULL icon */
+ if (! stock_id)
+ stock_id = GTK_STOCK_INFO;
+
pixbuf = gtk_widget_render_icon (GTK_WIDGET (entry),
stock_id,
GTK_ICON_SIZE_MENU,
#define GTK_ICON_ENTRY GTK_ENTRY
#define GTK_TYPE_ICON_ENTRY GTK_TYPE_ENTRY
#define gtk_icon_entry_new gtk_entry_new
- #define gtk_icon_entry_set_icon_from_stock gtk_entry_set_icon_from_stock
void
gtk_icon_entry_set_icon_from_pixbuf (GtkEntry* entry,
GtkEntryIconPosition position,
GdkPixbuf* pixbuf);
+ void
+ gtk_icon_entry_set_icon_from_stock (GtkEntry* entry,
+ GtkEntryIconPosition position,
+ const gchar* stock_id);
+
#define gtk_icon_entry_set_icon_highlight gtk_entry_set_icon_activatable
#else
MIDORI_LOCATION_ACTION (action), STOCK_NEWS_FEED);
else
midori_location_action_set_secondary_icon (
- MIDORI_LOCATION_ACTION (action), GTK_STOCK_INFO);
+ MIDORI_LOCATION_ACTION (action), NULL);
}
static void
midori_location_action_set_uri (
MIDORI_LOCATION_ACTION (action), uri);
midori_location_action_set_secondary_icon (
- MIDORI_LOCATION_ACTION (action), GTK_STOCK_INFO);
+ MIDORI_LOCATION_ACTION (action), NULL);
g_object_notify (G_OBJECT (browser), "uri");
}
"label", _("_Location..."),
"stock-id", GTK_STOCK_JUMP_TO,
"tooltip", _("Open a particular location"),
- /* FIXME: Due to a bug in GtkIconEntry we need to set an initial icon */
- "secondary-icon", STOCK_NEWS_FEED,
NULL);
g_object_connect (action,
"signal::activate",
entry = gtk_bin_get_child (GTK_BIN (alignment));
child = gtk_bin_get_child (GTK_BIN (entry));
- if (stock_id)
- gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (child),
- GTK_ICON_ENTRY_SECONDARY, stock_id);
- else
- gtk_icon_entry_set_icon_from_pixbuf (GTK_ICON_ENTRY (child),
- GTK_ICON_ENTRY_SECONDARY, NULL);
+ gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (child),
+ GTK_ICON_ENTRY_SECONDARY, stock_id);
}
}