[nautilus/wip/antoniof/flow-box-preparation: 28/46] view-icon-item-ui: Add more width for labels




commit ea26f94ef02aa8653e8199826b1fad24df826eb9
Author: António Fernandes <antoniof gnome org>
Date:   Mon Dec 13 13:22:43 2021 +0000

    view-icon-item-ui: Add more width for labels
    
    Except for the largest icon size, where there is plenty width already.
    
    This effectively adds more horizontal padding to icons. The result
    looks more similar to the canvas view, while still having better
    space efficiency for larger icons sizes.

 src/nautilus-view-icon-item-ui.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-view-icon-item-ui.c b/src/nautilus-view-icon-item-ui.c
index 8b8c4a73d..27d3129b9 100644
--- a/src/nautilus-view-icon-item-ui.c
+++ b/src/nautilus-view-icon-item-ui.c
@@ -23,6 +23,8 @@ enum
     N_PROPS
 };
 
+#define EXTRA_WIDTH_FOR_TEXT 36
+
 static void
 update_icon (NautilusViewIconItemUi *self)
 {
@@ -44,7 +46,10 @@ update_icon (NautilusViewIconItemUi *self)
                                                  TRUE, 1, flags);
     gtk_image_set_from_pixbuf (GTK_IMAGE (self->icon), icon_pixbuf);
 
-    gtk_widget_set_size_request (self->fixed_height_box, icon_size, icon_size);
+    gtk_widget_set_size_request (self->fixed_height_box,
+                                 MIN (icon_size + EXTRA_WIDTH_FOR_TEXT,
+                                      NAUTILUS_CANVAS_ICON_SIZE_LARGEST),
+                                 icon_size);
     style_context = gtk_widget_get_style_context (self->icon);
     thumbnail_path = nautilus_file_get_thumbnail_path (file);
     if (thumbnail_path != NULL &&


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