[nautilus/wip/antoniof/hidpi-and-icons-cleanup: 5/5] file: Avoid blurry missing-image in broken links




commit 1bf30900644dd114cabc00414bca01602a5bfeeb
Author: António Fernandes <antoniof gnome org>
Date:   Wed Aug 10 13:52:29 2022 +0100

    file: Avoid blurry missing-image in broken links
    
    When links are broken, i.e., their target is not found, the available
    icon names for this type of file are inode-symlink or inode-x-generic.
    
    None of them exist in adwaita-icon-theme, so, GTK adds a blurry
    image-missing icon instead.
    
    As a workaround, use our usual fallback: text-x-generic
    
    Workaround for https://gitlab.gnome.org/GNOME/nautilus/-/issues/2396

 src/nautilus-file.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 0f59e9d37..95f2b6ff0 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5054,6 +5054,12 @@ nautilus_file_get_gicon (NautilusFile          *file,
         }
     }
 
+    if (nautilus_file_is_broken_symbolic_link (file))
+    {
+        /* inode-symlink is not available in the icon theme */
+        return g_object_ref (get_default_file_icon ());
+    }
+
     if (file->details->icon)
     {
         icon = g_object_ref (file->details->icon);


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