Drop toolbar style setting

This commit is contained in:
Simon Steinbeiss
2021-01-04 00:13:04 +01:00
committed by Simon Steinbeiß
parent 21b01a4404
commit 977c2ddd10
3 changed files with 5 additions and 85 deletions

View File

@@ -70,7 +70,6 @@ static void emit_destroy_signal (XtmProcessWindow *window);
static gboolean xtm_process_window_configure_event (XtmProcessWindow *window, GdkEvent *event);
static gboolean xtm_process_vpaned_move_event (XtmProcessWindow *window, GdkEventButton *event);
static gboolean xtm_process_window_key_pressed (XtmProcessWindow *window, GdkEventKey *event);
static void toolbar_update_style (XtmProcessWindow *window);
static void monitor_update_step_size (XtmProcessWindow *window);
static void show_about_dialog (XtmProcessWindow *window);
@@ -243,8 +242,6 @@ xtm_process_window_init (XtmProcessWindow *window)
G_CALLBACK(xtm_process_window_configure_event), window);
window->toolbar = GTK_WIDGET (gtk_builder_get_object (window->builder, "process-toolbar"));
g_signal_connect_swapped (window->settings, "notify::toolbar-style", G_CALLBACK (toolbar_update_style), window);
g_object_notify (G_OBJECT (window->settings), "toolbar-style");
window->settings_button = xtm_settings_tool_button_new ();
gtk_toolbar_insert (GTK_TOOLBAR (window->toolbar), GTK_TOOL_ITEM (window->settings_button), 1);
@@ -410,36 +407,6 @@ xtm_process_window_key_pressed (XtmProcessWindow *window, GdkEventKey *event)
return ret;
}
static void
toolbar_update_style (XtmProcessWindow *window)
{
XtmToolbarStyle toolbar_style;
g_object_get (window->settings, "toolbar-style", &toolbar_style, NULL);
switch (toolbar_style)
{
default:
case XTM_TOOLBAR_STYLE_DEFAULT:
gtk_toolbar_set_icon_size (GTK_TOOLBAR (window->toolbar), GTK_ICON_SIZE_MENU);
gtk_toolbar_unset_style (GTK_TOOLBAR (window->toolbar));
break;
case XTM_TOOLBAR_STYLE_SMALL:
gtk_toolbar_set_icon_size (GTK_TOOLBAR (window->toolbar), GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_toolbar_set_style (GTK_TOOLBAR (window->toolbar), GTK_TOOLBAR_ICONS);
break;
case XTM_TOOLBAR_STYLE_LARGE:
gtk_toolbar_set_icon_size (GTK_TOOLBAR (window->toolbar), GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_toolbar_set_style (GTK_TOOLBAR (window->toolbar), GTK_TOOLBAR_ICONS);
break;
case XTM_TOOLBAR_STYLE_TEXT:
gtk_toolbar_set_icon_size (GTK_TOOLBAR (window->toolbar), GTK_ICON_SIZE_MENU);
gtk_toolbar_set_style (GTK_TOOLBAR (window->toolbar), GTK_TOOLBAR_BOTH);
break;
}
}
static void
monitor_update_step_size (XtmProcessWindow *window)
{

View File

@@ -109,29 +109,6 @@ xtm_settings_dialog_init (XtmSettingsDialog *dialog)
builder_bind_toggle_button (builder, "button-show-status-icon", dialog->settings, "show-status-icon");
builder_bind_toggle_button (builder, "button-process-tree", dialog->settings, "process-tree");
{
guint n;
GEnumClass *klass;
GtkWidget *box;
GtkWidget *combobox;
XtmToolbarStyle toolbar_style;
box = GTK_WIDGET (gtk_builder_get_object (builder, "hbox-toolbar-style"));
combobox = gtk_combo_box_text_new ();
gtk_box_pack_start (GTK_BOX (box), combobox, FALSE, FALSE, 0);
gtk_widget_show (combobox);
klass = g_type_class_ref (XTM_TYPE_TOOLBAR_STYLE);
for (n = 0; n < klass->n_values; ++n)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _(klass->values[n].value_nick));
g_type_class_unref (klass);
g_object_get (dialog->settings, "toolbar-style", &toolbar_style, NULL);
g_object_set_data (G_OBJECT (combobox), "setting-name", "toolbar-style");
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), (gint)toolbar_style);
g_signal_connect (combobox, "changed", G_CALLBACK (combobox_changed), dialog->settings);
}
g_object_unref (builder);
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="settings-dialog">
@@ -11,6 +11,9 @@
<property name="destroy_with_parent">True</property>
<property name="icon_name">gtk-preferences</property>
<property name="type_hint">normal</property>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox">
<property name="visible">True</property>
@@ -138,33 +141,6 @@
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox" id="hbox-toolbar-style">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label-toolbar-style">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Toolbar style:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">6</property>
</packing>
</child>
</object>
</child>
</object>
@@ -333,8 +309,8 @@
<object class="GtkLabel" id="label-columns">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Columns:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>