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




commit 63b327e77fded51ae1556da69d7cfbbfde82cb11
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 ad68e31ff..35f314d72 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 c47abad41..eac7c4387 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -200,7 +200,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]