Hide the User Stylesheet preference if unused
We have more powerful options in the form of addon panels by now. If someone uses it they may keep their preference or clear it, but otherwise we don't show the widget anymore.
This commit is contained in:
parent
4f80303e54
commit
c80b7053f4
1 changed files with 21 additions and 12 deletions
|
@ -226,6 +226,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
|
||||||
GtkWidget* entry;
|
GtkWidget* entry;
|
||||||
GtkWidget* hbox;
|
GtkWidget* hbox;
|
||||||
gint icon_width, icon_height;
|
gint icon_width, icon_height;
|
||||||
|
gchar* user_stylesheet_uri;
|
||||||
|
|
||||||
g_return_if_fail (MIDORI_IS_PREFERENCES (preferences));
|
g_return_if_fail (MIDORI_IS_PREFERENCES (preferences));
|
||||||
g_return_if_fail (MIDORI_IS_WEB_SETTINGS (settings));
|
g_return_if_fail (MIDORI_IS_WEB_SETTINGS (settings));
|
||||||
|
@ -336,18 +337,26 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
|
||||||
INDENTED_ADD (button, 0, 1, 2, 3);
|
INDENTED_ADD (button, 0, 1, 2, 3);
|
||||||
button = katze_property_proxy (settings, "enable-plugins", NULL);
|
button = katze_property_proxy (settings, "enable-plugins", NULL);
|
||||||
SPANNED_ADD (button, 1, 2, 2, 3);
|
SPANNED_ADD (button, 1, 2, 2, 3);
|
||||||
label = katze_property_label (settings, "user-stylesheet-uri");
|
g_object_get (settings, "user-stylesheet-uri", &user_stylesheet_uri, NULL);
|
||||||
INDENTED_ADD (label, 0, 1, 3, 4);
|
/* Add the stylesheet uri widget only if there's a value
|
||||||
hbox = gtk_hbox_new (FALSE, 4);
|
Otherwise we prefer to not use it, it is superfluous basically */
|
||||||
entry = katze_property_proxy (settings, "user-stylesheet-uri", "uri");
|
if (user_stylesheet_uri)
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
{
|
||||||
button = gtk_button_new ();
|
label = katze_property_label (settings, "user-stylesheet-uri");
|
||||||
gtk_container_add (GTK_CONTAINER (button),
|
INDENTED_ADD (label, 0, 1, 3, 4);
|
||||||
gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU));
|
hbox = gtk_hbox_new (FALSE, 4);
|
||||||
g_signal_connect (button, "clicked",
|
entry = katze_property_proxy (settings, "user-stylesheet-uri", "uri");
|
||||||
G_CALLBACK (clear_button_clicked_cb), entry);
|
gtk_widget_set_sensitive (entry, FALSE);
|
||||||
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 4);
|
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||||
FILLED_ADD (hbox, 1, 2, 3, 4);
|
button = gtk_button_new ();
|
||||||
|
gtk_container_add (GTK_CONTAINER (button),
|
||||||
|
gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU));
|
||||||
|
g_signal_connect (button, "clicked",
|
||||||
|
G_CALLBACK (clear_button_clicked_cb), entry);
|
||||||
|
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 4);
|
||||||
|
FILLED_ADD (hbox, 1, 2, 3, 4);
|
||||||
|
g_free (user_stylesheet_uri);
|
||||||
|
}
|
||||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (settings), "zoom-step"))
|
if (g_object_class_find_property (G_OBJECT_GET_CLASS (settings), "zoom-step"))
|
||||||
{
|
{
|
||||||
label = katze_property_label (settings, "zoom-step");
|
label = katze_property_label (settings, "zoom-step");
|
||||||
|
|
Loading…
Reference in a new issue