[nautilus/wip/antoniof/flow-box-preparation: 51/70] view-icon-item-ui: Add more width for labels
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/flow-box-preparation: 51/70] view-icon-item-ui: Add more width for labels
- Date: Thu, 23 Dec 2021 01:06:25 +0000 (UTC)
commit d64869f30009bdcfddcef85dc86db736cc2aa0ed
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]