From 61d233d8e6ee2e1dc19dd5d20dc05e96a8a287a0 Mon Sep 17 00:00:00 2001 From: Apoorv Sachan Date: Wed, 22 Jul 2020 02:51:44 +0530 Subject: properties-window: Follow HIG layout advice The GNOME Human Interface Guidelines include spacing rules for widgets laid out in a grid, and spacing from window edges: https://developer.gnome.org/hig/stable/visual-layout.html.en For vertical spacing between groups of controls, we have been using empty label widgets. This doesn't give us the control over the heigh that we need, so shall use margins instead. In case of the Basic page, due to the conditionality of the first widget in a group, instead of propper margins we use an empty box with a set heigh as a spacer. Also, prefer the GtkBox:spacing property over the padding child prop. --- src/nautilus-properties-window.c | 15 +-- src/resources/ui/nautilus-properties-window.ui | 177 ++++++++++++------------- 2 files changed, 84 insertions(+), 108 deletions(-) diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index e74d5471c..c83ef30e4 100644 --- a/src/nautilus-properties-window.c +++ b/src/nautilus-properties-window.c @@ -184,18 +184,12 @@ struct _NautilusPropertiesWindow GtkWidget *others_file_access_label; GtkWidget *others_file_access_combo; - GtkWidget *spacer_6; - GtkWidget *execute_label; GtkWidget *execute_checkbox; - GtkWidget *spacer_7; - GtkWidget *security_context_title_label; GtkWidget *security_context_value_label; - GtkWidget *spacer_8; - GtkWidget *change_permissions_button_box; GtkWidget *change_permissions_button; @@ -3269,7 +3263,6 @@ setup_execute_checkbox_with_label (NautilusPropertiesWindow *window, GtkLabel *label_for; label_for = GTK_LABEL (window->execute_label); - gtk_widget_show (window->spacer_6); gtk_widget_show (window->execute_label); gtk_widget_show (window->execute_checkbox); @@ -4267,7 +4260,6 @@ setup_permissions_page (NautilusPropertiesWindow *window) create_simple_permissions (window, GTK_GRID (window->permissions_grid)); #ifdef HAVE_SELINUX - gtk_widget_show (window->spacer_7); gtk_widget_show (window->security_context_title_label); gtk_widget_show (window->security_context_value_label); @@ -4279,8 +4271,6 @@ setup_permissions_page (NautilusPropertiesWindow *window) window->security_context_value_label); #endif - gtk_widget_show (window->spacer_8); - if (window->has_recursive_apply) { gtk_widget_show_all (window->change_permissions_button_box); @@ -4776,7 +4766,7 @@ setup_app_chooser_area (NautilusPropertiesWindow *window) GAppInfo *info; window->app_chooser_widget = gtk_app_chooser_widget_new (window->content_type); - gtk_box_pack_start (GTK_BOX (window->app_chooser_widget_box), window->app_chooser_widget, TRUE, TRUE, 6); + gtk_box_pack_start (GTK_BOX (window->app_chooser_widget_box), window->app_chooser_widget, TRUE, TRUE, 0); gtk_app_chooser_widget_set_show_default (GTK_APP_CHOOSER_WIDGET (window->app_chooser_widget), TRUE); gtk_app_chooser_widget_set_show_fallback (GTK_APP_CHOOSER_WIDGET (window->app_chooser_widget), TRUE); @@ -5655,13 +5645,10 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *klass) gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, others_access_combo); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, others_folder_access_combo); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, others_file_access_combo); - gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, spacer_6); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, execute_label); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, execute_checkbox); - gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, spacer_7); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, security_context_title_label); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, security_context_value_label); - gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, spacer_8); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, change_permissions_button_box); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, change_permissions_button); gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, open_with_box); diff --git a/src/resources/ui/nautilus-properties-window.ui b/src/resources/ui/nautilus-properties-window.ui index 250a6ca05..35ed31ecb 100644 --- a/src/resources/ui/nautilus-properties-window.ui +++ b/src/resources/ui/nautilus-properties-window.ui @@ -19,7 +19,7 @@ True False - 12 + 18 vertical 12 @@ -72,7 +72,6 @@ True False - 6 vertical 6 12 @@ -246,16 +245,6 @@ 4 - - - True - False - - - 0 - 5 - - False @@ -368,15 +357,6 @@ 12 - - - False - - - 0 - 8 - - False @@ -429,15 +409,6 @@ 10 - - - False - - - 0 - 13 - - False @@ -689,6 +660,49 @@ 3 + + + 6 + True + False + vertical + + + + + + 0 + 5 + + + + + 6 + False + vertical + + + + + + 0 + 8 + + + + + 6 + False + vertical + + + + + + 0 + 13 + + False @@ -721,7 +735,7 @@ False - 12 + 18 vertical @@ -765,7 +779,6 @@ False - 6 vertical 6 12 @@ -889,20 +902,11 @@ 3 - - - True - False - - - 0 - 4 - - True False + 12 _Group True group_combo_box @@ -925,6 +929,7 @@ True False start + 12 combo_box @@ -935,6 +940,7 @@ True False + 12 True 0 @@ -1019,20 +1025,11 @@ 8 - - - True - False - - - 0 - 9 - - True False + 12 Others 1