GtkWidget* bbox;
MidoriWebSettings* settings;
GtkWidget* button;
+ GtkWidget* image;
/* FIXME: Monitor each view and modify its settings individually
instead of merely replicating the global preferences. */
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
* 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.
*
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);
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 },