From 977c2ddd1030bc8804df15935fa467f44feb4448 Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Mon, 4 Jan 2021 00:13:04 +0100 Subject: [PATCH] Drop toolbar style setting --- src/process-window.c | 33 --------------------------------- src/settings-dialog.c | 23 ----------------------- src/settings-dialog.ui | 34 +++++----------------------------- 3 files changed, 5 insertions(+), 85 deletions(-) diff --git a/src/process-window.c b/src/process-window.c index a232cfc..acd9f18 100644 --- a/src/process-window.c +++ b/src/process-window.c @@ -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) { diff --git a/src/settings-dialog.c b/src/settings-dialog.c index 5eebc15..cd0cca2 100644 --- a/src/settings-dialog.c +++ b/src/settings-dialog.c @@ -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); } diff --git a/src/settings-dialog.ui b/src/settings-dialog.ui index 3e7f327..5aa26ab 100644 --- a/src/settings-dialog.ui +++ b/src/settings-dialog.ui @@ -1,5 +1,5 @@ - + @@ -11,6 +11,9 @@ True gtk-preferences normal + + + True @@ -138,33 +141,6 @@ 4 - - - True - False - 6 - - - True - False - Toolbar style: - - - False - False - 0 - - - - - - - - False - False - 6 - - @@ -333,8 +309,8 @@ True False - 0 Columns: + 0 False