[Xfce4-commits] <midori:master> Use inline icon for 'Use current page as homepage' instead of button
Christian Dywan
noreply at xfce.org
Fri Nov 13 19:50:04 CET 2009
Updating branch refs/heads/master
to a5ecd0b493b3643df13c330ac24a32d0deef153d (commit)
from 335efbc3aa3f6a152045d89c4f8f6cb96b5072a0 (commit)
commit a5ecd0b493b3643df13c330ac24a32d0deef153d
Author: Christian Dywan <christian at twotoasts.de>
Date: Fri Nov 13 19:37:15 2009 +0100
Use inline icon for 'Use current page as homepage' instead of button
midori/midori-preferences.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c
index c5f63b9..224cb5d 100644
--- a/midori/midori-preferences.c
+++ b/midori/midori-preferences.c
@@ -155,9 +155,17 @@ midori_preferences_new (GtkWindow* parent,
return GTK_WIDGET (preferences);
}
+#if GTK_CHECK_VERSION (2, 16, 0)
+static void
+midori_preferences_homepage_icon_press_cb (GtkWidget* button,
+ GtkEntryIconPosition position,
+ GdkEvent* event,
+ MidoriWebSettings* settings)
+#else
static void
midori_preferences_homepage_current_clicked_cb (GtkWidget* button,
MidoriWebSettings* settings)
+#endif
{
GtkWidget* preferences = gtk_widget_get_toplevel (button);
GtkWidget* browser = katze_object_get_object (preferences, "transient-for");
@@ -326,6 +334,14 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
SPANNED_ADD (entry);
if (parent && katze_object_has_property (parent, "uri"))
{
+ #if GTK_CHECK_VERSION (2, 16, 0)
+ gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
+ GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_JUMP_TO);
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
+ GTK_ENTRY_ICON_SECONDARY, _("Use current page as homepage"));
+ g_signal_connect (entry, "icon-press",
+ G_CALLBACK (midori_preferences_homepage_icon_press_cb), settings);
+ #else
button = gtk_button_new ();
label = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), label);
@@ -333,6 +349,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
g_signal_connect (button, "clicked",
G_CALLBACK (midori_preferences_homepage_current_clicked_cb), settings);
SPANNED_ADD (button);
+ #endif
}
button = katze_property_proxy (settings, "show-crash-dialog", NULL);
INDENTED_ADD (button);
More information about the Xfce4-commits
mailing list