[nautilus/wip/antoniof/post-gtk4-switch-fixes: 8/13] view-icon-item-ui: Use GtkPicture instead of GtkImage
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/post-gtk4-switch-fixes: 8/13] view-icon-item-ui: Use GtkPicture instead of GtkImage
- Date: Wed, 5 Jan 2022 13:29:17 +0000 (UTC)
commit c4ec9243b7a7b1793b754f2c9987e2c1a982b78a
Author: António Fernandes <antoniof gnome org>
Date: Fri Dec 24 00:07:17 2021 +0000
view-icon-item-ui: Use GtkPicture instead of GtkImage
GtkImage is simpler now, with only 2 available sizes. We need to use the
new GtkPicture instead to restore the expected icon sizes. It can grow
to fill the space available to fit the intrinsic size of the image.
-gtk-icon-filter CSS extensions don't work on GtkPicture. Instead, use
a filter to achieve a similar visual result.
src/nautilus-view-icon-item-ui.c | 2 +-
src/resources/css/Adwaita.css | 5 ++---
src/resources/ui/nautilus-view-icon-item-ui.ui | 3 ++-
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-view-icon-item-ui.c b/src/nautilus-view-icon-item-ui.c
index 344e0fc2a..8bb1e2abe 100644
--- a/src/nautilus-view-icon-item-ui.c
+++ b/src/nautilus-view-icon-item-ui.c
@@ -47,7 +47,7 @@ update_icon (NautilusViewIconItemUi *self)
NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM;
icon_paintable = nautilus_file_get_icon_paintable (file, icon_size, 1, flags);
- gtk_image_set_from_paintable (GTK_IMAGE (self->icon), icon_paintable);
+ gtk_picture_set_paintable (GTK_PICTURE (self->icon), icon_paintable);
gtk_widget_set_size_request (self->fixed_height_box, icon_size, icon_size);
if (icon_size < NAUTILUS_GRID_ICON_SIZE_LARGEST)
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 7c4d687e4..a05f44e27 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -186,7 +186,6 @@ flowboxchild:selected .icon-ui-labels-box {
color: @accent_fg_color;
}
-flowboxchild:selected image {
- -gtk-icon-filter: opacity(0.5);
- -gtk-icon-shadow: 0px 0px @accent_bg_color;
+flowboxchild:selected picture {
+ filter: sepia(1.5) hue-rotate(180deg) brightness(0.5) saturate(2.0);
}
diff --git a/src/resources/ui/nautilus-view-icon-item-ui.ui b/src/resources/ui/nautilus-view-icon-item-ui.ui
index fa1fe25e1..624a5a178 100644
--- a/src/resources/ui/nautilus-view-icon-item-ui.ui
+++ b/src/resources/ui/nautilus-view-icon-item-ui.ui
@@ -17,11 +17,12 @@
<property name="valign">center</property>
<property name="width-request">96</property>
<child>
- <object class="GtkImage" id="icon">
+ <object class="GtkPicture" id="icon">
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="valign">end</property>
<property name="vexpand">True</property>
+ <property name="can-shrink">False</property>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]