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;
MidoriWebSettings* settings;
GtkWidget* button;
GtkWidget* image;
/* FIXME: Monitor each view and modify its settings individually
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");
bbox = gtk_hbox_new (FALSE, 0);
settings = katze_object_get_object (browser, "settings");
button = katze_property_proxy (settings, "auto-load-images", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Images"));
button = katze_property_proxy (settings, "auto-load-images", "toggle");
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)
gtk_widget_set_tooltip_text (button, _("Load images automatically"));
#endif
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2);
gtk_widget_show (button);
button = katze_property_proxy (settings, "enable-scripts", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Scripts"));
button = katze_property_proxy (settings, "enable-scripts", "toggle");
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)
gtk_widget_set_tooltip_text (button, _("Enable scripts"));
#endif
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2);
gtk_widget_show (button);
button = katze_property_proxy (settings, "enable-plugins", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Plugins"));
button = katze_property_proxy (settings, "enable-plugins", "toggle");
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)
gtk_widget_set_tooltip_text (button, _("Enable plugins"));
#endif

View file

@ -150,6 +150,9 @@ proxy_object_notify_string_cb (GObject* object,
* choosing an existing filename, encoded as an URI.
* "font": the widget created will be particularly suitable for
* 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.
*
@ -193,7 +196,10 @@ katze_property_proxy (gpointer object,
gchar* notify_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);
g_signal_connect (widget, "toggled",
G_CALLBACK (proxy_toggle_button_toggled_cb), object);

View file

@ -769,6 +769,7 @@ sokoke_register_stock_items (void)
static FatStockItem items[] =
{
{ 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_SCRIPT, NULL, 0, 0, GTK_STOCK_EXECUTE },
{ STOCK_STYLE, NULL, 0, 0, GTK_STOCK_SELECT_COLOR },