[nautilus/gtk4-preparation-trunk: 16/64] general: Replace thumbnail frame with shadow




commit 39f98ac5a5433fe55cd4a6c05eb62661c06722c7
Author: António Fernandes <antoniof gnome org>
Date:   Tue Nov 2 21:57:50 2021 +0000

    general: Replace thumbnail frame with shadow
    
    Shadows are present in design mockups, frame is not.
    
    Also, shadows can be done with CSS, instead of transforming pixbufs.
    
    Furthermore, this removes another use of libgd, which we want to stop
    depending on as part of the GTK 3-to-4 migration.

 icons/thumbnail_frame.png            | Bin 482 -> 0 bytes
 src/nautilus-ui-utilities.c          |  25 -------------------------
 src/nautilus-ui-utilities.h          |   1 -
 src/resources/css/Adwaita.css        |   4 ++++
 src/resources/nautilus.gresource.xml |   1 -
 5 files changed, 4 insertions(+), 27 deletions(-)
---
diff --git a/src/nautilus-ui-utilities.c b/src/nautilus-ui-utilities.c
index 195f765f9..79a624a14 100644
--- a/src/nautilus-ui-utilities.c
+++ b/src/nautilus-ui-utilities.c
@@ -28,7 +28,6 @@
 
 #include <gio/gio.h>
 #include <gtk/gtk.h>
-#include <libgd/gd.h>
 #include <string.h>
 #include <glib/gi18n.h>
 
@@ -68,30 +67,6 @@ nautilus_gmenu_set_from_model (GMenu      *target_menu,
     }
 }
 
-#define NAUTILUS_THUMBNAIL_FRAME_LEFT 3
-#define NAUTILUS_THUMBNAIL_FRAME_TOP 3
-#define NAUTILUS_THUMBNAIL_FRAME_RIGHT 3
-#define NAUTILUS_THUMBNAIL_FRAME_BOTTOM 3
-
-void
-nautilus_ui_frame_image (GdkPixbuf **pixbuf)
-{
-    GtkBorder border;
-    GdkPixbuf *pixbuf_with_frame;
-
-    border.left = NAUTILUS_THUMBNAIL_FRAME_LEFT;
-    border.top = NAUTILUS_THUMBNAIL_FRAME_TOP;
-    border.right = NAUTILUS_THUMBNAIL_FRAME_RIGHT;
-    border.bottom = NAUTILUS_THUMBNAIL_FRAME_BOTTOM;
-
-    pixbuf_with_frame = gd_embed_image_in_frame (*pixbuf,
-                                                 "resource:///org/gnome/nautilus/icons/thumbnail_frame.png",
-                                                 &border, &border);
-    g_object_unref (*pixbuf);
-
-    *pixbuf = pixbuf_with_frame;
-}
-
 static GdkPixbuf *filmholes_left = NULL;
 static GdkPixbuf *filmholes_right = NULL;
 
diff --git a/src/nautilus-ui-utilities.h b/src/nautilus-ui-utilities.h
index 1136e1de6..ed00f5fc7 100644
--- a/src/nautilus-ui-utilities.h
+++ b/src/nautilus-ui-utilities.h
@@ -28,7 +28,6 @@
 void        nautilus_gmenu_set_from_model           (GMenu             *target_menu,
                                                      GMenuModel        *source_model);
 
-void        nautilus_ui_frame_image                 (GdkPixbuf        **pixbuf);
 void        nautilus_ui_frame_video                 (GdkPixbuf        **pixbuf);
 
 gboolean    nautilus_file_date_in_between           (guint64            file_unix_time,
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 7d82463d4..d15124ee4 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -175,6 +175,10 @@ entry.search > * {
     border-bottom: 1px solid @theme_bg_color;
 }
 
+.nautilus-list-view.thumbnail {
+  -gtk-icon-shadow: 0px 1px 2px darker(@borders);
+}
+
 .search-information {
   background-color: @theme_selected_bg_color;
   color:white;
diff --git a/src/resources/nautilus.gresource.xml b/src/resources/nautilus.gresource.xml
index a36a89945..69c9f68e9 100644
--- a/src/resources/nautilus.gresource.xml
+++ b/src/resources/nautilus.gresource.xml
@@ -30,7 +30,6 @@
     <file alias="gtk/ui/nautilusgtksidebarrow.ui">../gtk/nautilusgtksidebarrow.ui</file>
     <file alias="gtk/ui/nautilusgtkplacesview.ui">../gtk/nautilusgtkplacesview.ui</file>
     <file alias="gtk/ui/nautilusgtkplacesviewrow.ui">../gtk/nautilusgtkplacesviewrow.ui</file>
-    <file alias="icons/thumbnail_frame.png">../../icons/thumbnail_frame.png</file>
     <file alias="icons/filmholes.png">../../icons/filmholes.png</file>
     <file>css/Adwaita.css</file>
     <file>css/nautilus.css</file>


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