Show only image buttons in Statusbar Features in statusbar

This commit is contained in:
Christian Dywan 2009-04-17 03:16:37 +02:00
parent a9863cfb40
commit ad82a73ab8
3 changed files with 21 additions and 7 deletions

View file

@ -38,6 +38,7 @@ statusbar_features_app_add_browser_cb (MidoriApp* app,
GtkWidget* bbox; GtkWidget* bbox;
MidoriWebSettings* settings; MidoriWebSettings* settings;
GtkWidget* button; GtkWidget* button;
GtkWidget* image;
/* FIXME: Monitor each view and modify its settings individually /* FIXME: Monitor each view and modify its settings individually
instead of merely replicating the global preferences. */ instead of merely replicating the global preferences. */
@ -45,22 +46,28 @@ statusbar_features_app_add_browser_cb (MidoriApp* app,
statusbar = katze_object_get_object (browser, "statusbar"); statusbar = katze_object_get_object (browser, "statusbar");
bbox = gtk_hbox_new (FALSE, 0); bbox = gtk_hbox_new (FALSE, 0);
settings = katze_object_get_object (browser, "settings"); settings = katze_object_get_object (browser, "settings");
button = katze_property_proxy (settings, "auto-load-images", NULL); button = katze_property_proxy (settings, "auto-load-images", "toggle");
gtk_button_set_label (GTK_BUTTON (button), _("Images")); image = gtk_image_new_from_stock (STOCK_IMAGE, GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
gtk_container_add (GTK_CONTAINER (button), image);
#if GTK_CHECK_VERSION(2, 12, 0) #if GTK_CHECK_VERSION(2, 12, 0)
gtk_widget_set_tooltip_text (button, _("Load images automatically")); gtk_widget_set_tooltip_text (button, _("Load images automatically"));
#endif #endif
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2);
gtk_widget_show (button); gtk_widget_show (button);
button = katze_property_proxy (settings, "enable-scripts", NULL); button = katze_property_proxy (settings, "enable-scripts", "toggle");
gtk_button_set_label (GTK_BUTTON (button), _("Scripts")); image = gtk_image_new_from_stock (STOCK_SCRIPTS, GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
gtk_container_add (GTK_CONTAINER (button), image);
#if GTK_CHECK_VERSION(2, 12, 0) #if GTK_CHECK_VERSION(2, 12, 0)
gtk_widget_set_tooltip_text (button, _("Enable scripts")); gtk_widget_set_tooltip_text (button, _("Enable scripts"));
#endif #endif
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2);
gtk_widget_show (button); gtk_widget_show (button);
button = katze_property_proxy (settings, "enable-plugins", NULL); button = katze_property_proxy (settings, "enable-plugins", "toggle");
gtk_button_set_label (GTK_BUTTON (button), _("Plugins")); image = gtk_image_new_from_stock (STOCK_PLUGINS, GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
gtk_container_add (GTK_CONTAINER (button), image);
#if GTK_CHECK_VERSION(2, 12, 0) #if GTK_CHECK_VERSION(2, 12, 0)
gtk_widget_set_tooltip_text (button, _("Enable plugins")); gtk_widget_set_tooltip_text (button, _("Enable plugins"));
#endif #endif

View file

@ -150,6 +150,9 @@ proxy_object_notify_string_cb (GObject* object,
* choosing an existing filename, encoded as an URI. * choosing an existing filename, encoded as an URI.
* "font": the widget created will be particularly suitable for * "font": the widget created will be particularly suitable for
* choosing a font from installed fonts. * choosing a font from installed fonts.
* Since 0.1.6 the following hints are also supported:
* "toggle": the widget created will be an empty toggle button. This
* is only supported with boolean properties.
* *
* Any other values for @hint are silently ignored. * Any other values for @hint are silently ignored.
* *
@ -193,7 +196,10 @@ katze_property_proxy (gpointer object,
gchar* notify_property; gchar* notify_property;
gboolean toggled = katze_object_get_boolean (object, property); gboolean toggled = katze_object_get_boolean (object, property);
widget = gtk_check_button_new_with_label (gettext (nick)); if (_hint == g_intern_string ("toggle"))
widget = gtk_toggle_button_new ();
else
widget = gtk_check_button_new_with_label (gettext (nick));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), toggled); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), toggled);
g_signal_connect (widget, "toggled", g_signal_connect (widget, "toggled",
G_CALLBACK (proxy_toggle_button_toggled_cb), object); G_CALLBACK (proxy_toggle_button_toggled_cb), object);

View file

@ -769,6 +769,7 @@ sokoke_register_stock_items (void)
static FatStockItem items[] = static FatStockItem items[] =
{ {
{ STOCK_EXTENSION, NULL, 0, 0, GTK_STOCK_CONVERT }, { STOCK_EXTENSION, NULL, 0, 0, GTK_STOCK_CONVERT },
{ STOCK_IMAGE, NULL, 0, 0, GTK_STOCK_ORIENTATION_PORTRAIT },
{ STOCK_NEWS_FEED, NULL, 0, 0, GTK_STOCK_INDEX }, { STOCK_NEWS_FEED, NULL, 0, 0, GTK_STOCK_INDEX },
{ STOCK_SCRIPT, NULL, 0, 0, GTK_STOCK_EXECUTE }, { STOCK_SCRIPT, NULL, 0, 0, GTK_STOCK_EXECUTE },
{ STOCK_STYLE, NULL, 0, 0, GTK_STOCK_SELECT_COLOR }, { STOCK_STYLE, NULL, 0, 0, GTK_STOCK_SELECT_COLOR },