Commit 55bbc253 authored by Simon Steinbeiss's avatar Simon Steinbeiss
Browse files

appearance: Drop toolbar style setting (Bug #16665)

This setting was relevant when Gtk2 was the main toolkit and toolbars
still respected this setting (or even existed as a widespread UI
element).
Now that we also dropped exotoolbar this setting should also go.

We keep the default setting (style: icon, size: 3) in case users still
have Gtk2 apps that respect this setting.
parent 33ccd6ca
Loading
Loading
Loading
Loading
Loading
+9 −56
Original line number Diff line number Diff line
@@ -107,34 +107,34 @@
            <property name="can_focus">False</property>
            <property name="layout_style">end</property>
            <child>
              <object class="GtkButton" id="button2">
                <property name="label" translatable="yes">_Help</property>
              <object class="GtkButton" id="button1">
                <property name="label" translatable="yes">_Close</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="image">image2</property>
                <property name="image">image1</property>
                <property name="use_underline">True</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">0</property>
                <property name="secondary">True</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="button1">
                <property name="label" translatable="yes">_Close</property>
              <object class="GtkButton" id="button2">
                <property name="label" translatable="yes">_Help</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="image">image1</property>
                <property name="image">image2</property>
                <property name="use_underline">True</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">0</property>
                <property name="secondary">True</property>
              </packing>
            </child>
          </object>
@@ -571,53 +571,6 @@
                        <property name="border_width">12</property>
                        <property name="orientation">vertical</property>
                        <property name="spacing">18</property>
                        <child>
                          <object class="GtkFrame" id="frame2">
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <property name="label_xalign">0</property>
                            <property name="shadow_type">none</property>
                            <child>
                              <object class="GtkAlignment" id="alignment2">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="top_padding">6</property>
                                <property name="left_padding">12</property>
                                <child>
                                  <object class="GtkComboBox" id="gtk_toolbar_style_combo_box">
                                    <property name="visible">True</property>
                                    <property name="can_focus">False</property>
                                    <property name="tooltip_text" translatable="yes">Specify what should be displayed in toolbar items</property>
                                    <property name="model">liststore2</property>
                                    <child>
                                      <object class="GtkCellRendererText" id="cellrenderertext2"/>
                                      <attributes>
                                        <attribute name="text">0</attribute>
                                      </attributes>
                                    </child>
                                  </object>
                                </child>
                              </object>
                            </child>
                            <child type="label">
                              <object class="GtkLabel" id="label6">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="label" translatable="yes">_Toolbar Style</property>
                                <property name="use_underline">True</property>
                                <property name="mnemonic_widget">gtk_toolbar_style_combo_box</property>
                                <attributes>
                                  <attribute name="weight" value="bold"/>
                                </attributes>
                              </object>
                            </child>
                          </object>
                          <packing>
                            <property name="expand">False</property>
                            <property name="fill">True</property>
                            <property name="position">0</property>
                          </packing>
                        </child>
                        <child>
                          <object class="GtkFrame" id="frame1">
                            <property name="visible">True</property>
@@ -816,7 +769,7 @@
                                <property name="can_focus">False</property>
                                <property name="label" translatable="yes">_Window Scaling</property>
                                <property name="use_underline">True</property>
                                <property name="mnemonic_widget">gtk_toolbar_style_combo_box</property>
                                <property name="mnemonic_widget">gdk_window_scaling_factor_combo_box</property>
                                <attributes>
                                  <attribute name="weight" value="bold"/>
                                </attributes>
@@ -860,8 +813,8 @@
      </object>
    </child>
    <action-widgets>
      <action-widget response="-11">button2</action-widget>
      <action-widget response="0">button1</action-widget>
      <action-widget response="-11">button2</action-widget>
    </action-widgets>
  </object>
</interface>
+0 −37
Original line number Diff line number Diff line
@@ -80,12 +80,6 @@ enum {
	NUM_SYMBOLIC_COLORS
};

/* String arrays with the settings in combo boxes */
static const gchar* toolbar_styles_array[] =
{
    "icons", "text", "both", "both-horiz"
};

static const gchar* xft_hint_styles_array[] =
{
    "hintnone", "hintslight", "hintmedium", "hintfull"
@@ -218,18 +212,6 @@ cb_ui_theme_tree_selection_changed (GtkTreeSelection *selection)
    cb_theme_tree_selection_changed (selection, "/Net/ThemeName");
}

static void
cb_toolbar_style_combo_changed (GtkComboBox *combo)
{
    gint active;

    /* Get active item, prevent number outside the array (stay within zero-index) */
    active = CLAMP (gtk_combo_box_get_active (combo), 0, (gint) G_N_ELEMENTS (toolbar_styles_array)-1);

    /* Save setting */
    xfconf_channel_set_string (xsettings_channel, "/Gtk/ToolbarStyle", toolbar_styles_array[active]);
}

static void
cb_window_scaling_factor_combo_changed (GtkComboBox *combo)
{
@@ -677,20 +659,6 @@ appearance_settings_dialog_channel_property_changed (XfconfChannel *channel,
        }
        g_free (str);
    }
    else if (strcmp (property_name, "/Gtk/ToolbarStyle") == 0)
    {
        str = xfconf_channel_get_string (xsettings_channel, property_name, toolbar_styles_array[2]);
        for (i = 0; i < G_N_ELEMENTS (toolbar_styles_array); i++)
        {
            if (strcmp (str, toolbar_styles_array[i]) == 0)
            {
                object = gtk_builder_get_object (builder, "gtk_toolbar_style_combo_box");
                gtk_combo_box_set_active (GTK_COMBO_BOX (object), i);
                break;
            }
        }
        g_free (str);
    }
    else if (strcmp (property_name, "/Gdk/WindowScalingFactor") == 0)
    {
        i = xfconf_channel_get_int (xsettings_channel, property_name, 1);
@@ -1086,11 +1054,6 @@ appearance_settings_dialog_configure_widgets (GtkBuilder *builder)
    xfconf_g_property_bind (xsettings_channel,  "/Gtk/MonospaceFontName", G_TYPE_STRING,
                            G_OBJECT (object), "font-name");

    /* Toolbar style */
    object = gtk_builder_get_object (builder, "gtk_toolbar_style_combo_box");
    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Gtk/ToolbarStyle", NULL, builder);
    g_signal_connect (G_OBJECT (object), "changed", G_CALLBACK(cb_toolbar_style_combo_changed), NULL);

    /* Hinting style */
    object = gtk_builder_get_object (builder, "xft_hinting_style_combo_box");
    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/HintStyle", NULL, builder);