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




commit ddc5302c65c71c4c3c6cac1365a4ae6be8e1eb77
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 daea26b3b..508888da9 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5065,6 +5065,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]