[nautilus/wip/antoniof/new-list-view-without-expanders: 16/20] list-view: Make small icons mode compact
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/new-list-view-without-expanders: 16/20] list-view: Make small icons mode compact
- Date: Sat, 4 Jun 2022 00:10:23 +0000 (UTC)
commit 3fba2523ddd703e93a6d7bd2171e8d0a464193a5
Author: António Fernandes <antoniof gnome org>
Date: Fri Jun 3 20:34:09 2022 +0100
list-view: Make small icons mode compact
At 16 pixels, icons are as tall as text.
As such, we can use this mode to maximize the number of items shown.
src/nautilus-list-view.c | 9 +++++++++
src/resources/css/Adwaita.css | 12 +++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 5801d7716..b9aa69fea 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -669,6 +669,15 @@ set_zoom_level (NautilusListView *self,
nautilus_files_model_view_set_icon_size (NAUTILUS_FILES_MODEL_VIEW (self),
get_icon_size_for_zoom_level (new_level));
+ if (self->zoom_level == NAUTILUS_LIST_ZOOM_LEVEL_SMALL)
+ {
+ gtk_widget_add_css_class (GTK_WIDGET (self), "compact");
+ }
+ else
+ {
+ gtk_widget_remove_css_class (GTK_WIDGET (self), "compact");
+ }
+
nautilus_files_view_update_toolbar_menus (NAUTILUS_FILES_VIEW (self));
}
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 521ffefd8..4b15d1479 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -183,11 +183,21 @@
margin-bottom: 4px;
}
+.nautilus-list-view.compact columnview > listview > row {
+ margin-top: 2px;
+ margin-bottom: 2px;
+}
+
.nautilus-list-view columnview > listview > row > * {
padding: 6px;
}
-.nautilus-list-view .star {
+.nautilus-list-view.compact columnview > listview > row > * {
+ padding-top: 3px;
+ padding-bottom: 3px;
+}
+
+.nautilus-list-view:not(.compact) .star {
padding: 6px;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]