[nautilus] css: Checkerboard background for thumbnails transparent areas



commit 39cd4359dd7c40d3846ab6beaa0574bc959db905
Author: Utkarsh Gandhi <utkarshvg2401 gmail com>
Date:   Sat Apr 9 23:46:45 2022 +0000

    css: Checkerboard background for thumbnails transparent areas
    
    Currently, images with transparent backgrounds have their thumbnails
    displayed with a white background image, which causes a visibility
    issue for white images with no background in light mode.
    
    Hence, a checkerboard background is added to the thumbnails of these
    images, making them clearly visible.
    
    Close https://gitlab.gnome.org/GNOME/nautilus/-/issues/2211

 src/resources/Checkerboard.png       | Bin 0 -> 184 bytes
 src/resources/css/Adwaita.css        |   2 +-
 src/resources/nautilus.gresource.xml |   1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/resources/Checkerboard.png b/src/resources/Checkerboard.png
new file mode 100644
index 000000000..3e43acd93
Binary files /dev/null and b/src/resources/Checkerboard.png differ
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 6a59b4d76..830eeed06 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -166,7 +166,7 @@
 }
 
 .nautilus-grid-view .thumbnail {
-  background-color: @shade_color;
+  background: url('/org/gnome/nautilus/Checkerboard.png') repeat;
   box-shadow: 0px 1px 2px 0px @shade_color,
               0px 0px 0px 1px @shade_color,
               0px 2px 0px 0px @shade_color;
diff --git a/src/resources/nautilus.gresource.xml b/src/resources/nautilus.gresource.xml
index d27f7b5ff..304814f75 100644
--- a/src/resources/nautilus.gresource.xml
+++ b/src/resources/nautilus.gresource.xml
@@ -33,5 +33,6 @@
     <file>css/Adwaita.css</file>
     <file>css/nautilus.css</file>
     <file>text-x-preview.png</file>
+    <file>Checkerboard.png</file>
   </gresource>
 </gresources>


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