[nautilus/wip/antoniof/flow-box-preparation: 64/68] view-icon-controller: Allow background click around items




commit afe4fad4e0672ae7bdca3e42eaf2bf08250e5b77
Author: António Fernandes <antoniof gnome org>
Date:   Wed Dec 22 14:11:19 2021 +0000

    view-icon-controller: Allow background click around items
    
    The old grid view allows users to clear selection and to bring up the
    background context menu by clicking the blank space around items.
    
    In order to achive feature parity, introduce row and column spacing,
    increas outer padding and free up the extra space under the file name.
    
    Also, to avoid compensate for the added spacing, also remove the
    padding in flowboxchild.

 src/nautilus-view-icon-controller.c            | 2 ++
 src/resources/css/Adwaita.css                  | 6 +++++-
 src/resources/ui/nautilus-view-icon-item-ui.ui | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c
index 7f17a03f6..1045a63d6 100644
--- a/src/nautilus-view-icon-controller.c
+++ b/src/nautilus-view-icon-controller.c
@@ -1353,6 +1353,8 @@ create_view_ui (NautilusViewIconController *self)
     gtk_flow_box_set_max_children_per_line (flowbox, 20);
     gtk_flow_box_set_selection_mode (flowbox, GTK_SELECTION_MULTIPLE);
     gtk_flow_box_set_homogeneous (flowbox, FALSE);
+    gtk_flow_box_set_column_spacing (flowbox, 6);
+    gtk_flow_box_set_row_spacing (flowbox, 6);
 
     return flowbox;
 }
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index d0e7a25c3..968794388 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -211,7 +211,11 @@ entry.search > * {
 
 /* Icon view */
 flowbox {
-  padding: 10px
+  padding: 18px
+}
+
+flowboxchild {
+  padding: 0px;
 }
 
 flowboxchild:selected {
diff --git a/src/resources/ui/nautilus-view-icon-item-ui.ui b/src/resources/ui/nautilus-view-icon-item-ui.ui
index ba76d24c2..6e6121f0b 100644
--- a/src/resources/ui/nautilus-view-icon-item-ui.ui
+++ b/src/resources/ui/nautilus-view-icon-item-ui.ui
@@ -2,6 +2,8 @@
 <interface>
   <requires lib="gtk+" version="3.0"/>
   <template class="NautilusViewIconItemUi" parent="GtkFlowBoxChild">
+    <property name="halign">center</property>
+    <property name="valign">start</property>
     <child>
       <object class="GtkBox">
         <property name="orientation">vertical</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]