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




commit 4a5125a115fe6e105893e8638fa8e24875e0adc9
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 02e8307b0..2cdfe0e48 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]