From a1663f1b5c02f029f2902e44eff7b85203b14e15 Mon Sep 17 00:00:00 2001 From: mbkma Date: Thu, 26 Nov 2020 22:27:09 +0100 Subject: Revisit windows applet, add allow-top-tiling option --- capplets/windows/mate-window-properties.c | 57 ++-- capplets/windows/window-properties.ui | 476 +++++++++++++++++++++--------- 2 files changed, 379 insertions(+), 154 deletions(-) (limited to 'capplets') diff --git a/capplets/windows/mate-window-properties.c b/capplets/windows/mate-window-properties.c index 8cb185e0..4d0849b5 100644 --- a/capplets/windows/mate-window-properties.c +++ b/capplets/windows/mate-window-properties.c @@ -43,6 +43,7 @@ #define MARCO_CENTER_NEW_WINDOWS_KEY "center-new-windows" #define MARCO_ALLOW_TILING_KEY "allow-tiling" +#define MARCO_ALLOW_TOP_TILING_KEY "allow-top-tiling" #define MARCO_SHOW_TAB_BORDER_KEY "show-tab-border" #define MARCO_BUTTON_LAYOUT_KEY "button-layout" #define MARCO_DOUBLE_CLICK_TITLEBAR_KEY "action-double-click-titlebar" @@ -88,19 +89,23 @@ typedef struct static GtkWidget *dialog_win; -/* General */ -static GtkWidget *center_new_windows_checkbutton; -static GtkWidget *allow_tiling_checkbutton; +/* Behaviour */ static GtkWidget *show_tab_border_checkbutton; -static GtkWidget *titlebar_layout_optionmenu; static GtkWidget *double_click_titlebar_optionmenu; static GtkWidget *focus_mode_checkbutton; static GtkWidget *focus_mode_mouse_checkbutton; static GtkWidget *autoraise_checkbutton; static GtkWidget *autoraise_delay_spinbutton; +static GtkWidget *autoraise_delay_hbox; static GtkWidget *reduced_resources_checkbutton; static GtkWidget *alt_click_vbox; +/* Placement */ +static GtkWidget *center_new_windows_checkbutton; +static GtkWidget *enable_tiling_checkbutton; +static GtkWidget *allow_top_tiling_checkbutton; +static GtkWidget *titlebar_layout_optionmenu; + /* Compositing Manager */ static GtkWidget *compositing_checkbutton; static GtkWidget *compositing_fast_alt_tab_checkbutton; @@ -119,11 +124,14 @@ update_sensitivity (void) gtk_widget_set_sensitive (compositing_fast_alt_tab_checkbutton, g_settings_get_boolean (marco_settings, MARCO_COMPOSITING_MANAGER_KEY)); - gtk_widget_set_sensitive (allow_tiling_checkbutton, + gtk_widget_set_sensitive (enable_tiling_checkbutton, !g_settings_get_boolean (marco_settings, MARCO_REDUCED_RESOURCES_KEY)); + gtk_widget_set_sensitive (allow_top_tiling_checkbutton, + g_settings_get_boolean (marco_settings, MARCO_ALLOW_TILING_KEY) && + !g_settings_get_boolean (marco_settings, MARCO_REDUCED_RESOURCES_KEY)); gtk_widget_set_sensitive (focus_mode_mouse_checkbutton, g_settings_get_enum (marco_settings, MARCO_FOCUS_KEY) != FOCUS_MODE_CLICK); - gtk_widget_set_sensitive (autoraise_checkbutton, + gtk_widget_set_sensitive (autoraise_delay_hbox, g_settings_get_enum (marco_settings, MARCO_FOCUS_KEY) != FOCUS_MODE_CLICK); gtk_widget_set_sensitive (autoraise_delay_spinbutton, g_settings_get_enum (marco_settings, MARCO_FOCUS_KEY) != FOCUS_MODE_CLICK && @@ -352,19 +360,23 @@ main (int argc, char **argv) G_CALLBACK (capplet_notebook_scroll_event_cb), NULL); - /* General */ - center_new_windows_checkbutton = GET_WIDGET ("center_new_windows_checkbutton"); - allow_tiling_checkbutton = GET_WIDGET ("allow_tiling_checkbutton"); + /* Behaviour */ show_tab_border_checkbutton = GET_WIDGET ("show_tab_border_checkbutton"); - titlebar_layout_optionmenu = GET_WIDGET ("titlebar_layout_optionmenu"); double_click_titlebar_optionmenu = GET_WIDGET ("double_click_titlebar_optionmenu"); focus_mode_checkbutton = GET_WIDGET ("focus_mode_checkbutton"); focus_mode_mouse_checkbutton = GET_WIDGET ("focus_mode_mouse_checkbutton"); + autoraise_delay_hbox = GET_WIDGET ("autoraise_delay_hbox"); autoraise_checkbutton = GET_WIDGET ("autoraise_checkbutton"); autoraise_delay_spinbutton = GET_WIDGET ("autoraise_delay_spinbutton"); reduced_resources_checkbutton = GET_WIDGET ("reduced_resources_checkbutton"); alt_click_vbox = GET_WIDGET ("alt_click_vbox"); + /* Placement */ + center_new_windows_checkbutton = GET_WIDGET ("center_new_windows_checkbutton"); + enable_tiling_checkbutton = GET_WIDGET ("enable_tiling_checkbutton"); + allow_top_tiling_checkbutton = GET_WIDGET ("allow_top_tiling_checkbutton"); + titlebar_layout_optionmenu = GET_WIDGET ("titlebar_layout_optionmenu"); + /* Composition Manager */ compositing_checkbutton = GET_WIDGET ("compositing_checkbutton"); compositing_fast_alt_tab_checkbutton = GET_WIDGET ("compositing_fast_alt_tab_checkbutton"); @@ -391,28 +403,35 @@ main (int argc, char **argv) gtk_combo_box_set_active (GTK_COMBO_BOX (double_click_titlebar_optionmenu), g_settings_get_enum (marco_settings, MARCO_DOUBLE_CLICK_TITLEBAR_KEY)); - /* General */ + /* Behaviour */ g_settings_bind (marco_settings, - MARCO_CENTER_NEW_WINDOWS_KEY, - center_new_windows_checkbutton, + MARCO_SHOW_TAB_BORDER_KEY, + show_tab_border_checkbutton, "active", G_SETTINGS_BIND_DEFAULT); g_settings_bind (marco_settings, - MARCO_ALLOW_TILING_KEY, - allow_tiling_checkbutton, + MARCO_REDUCED_RESOURCES_KEY, + reduced_resources_checkbutton, "active", G_SETTINGS_BIND_DEFAULT); + /* Placement */ g_settings_bind (marco_settings, - MARCO_SHOW_TAB_BORDER_KEY, - show_tab_border_checkbutton, + MARCO_CENTER_NEW_WINDOWS_KEY, + center_new_windows_checkbutton, "active", G_SETTINGS_BIND_DEFAULT); g_settings_bind (marco_settings, - MARCO_REDUCED_RESOURCES_KEY, - reduced_resources_checkbutton, + MARCO_ALLOW_TILING_KEY, + enable_tiling_checkbutton, + "active", + G_SETTINGS_BIND_DEFAULT); + + g_settings_bind (marco_settings, + MARCO_ALLOW_TOP_TILING_KEY, + allow_top_tiling_checkbutton, "active", G_SETTINGS_BIND_DEFAULT); diff --git a/capplets/windows/window-properties.ui b/capplets/windows/window-properties.ui index 0f634059..556df178 100644 --- a/capplets/windows/window-properties.ui +++ b/capplets/windows/window-properties.ui @@ -1,5 +1,5 @@ -