[nautilus/gtk4-preparation-trunk: 58/64] general: Stop using GEmblemedIcon




commit 63739d18e0add45b812b0efe3a2faf07858cf65c
Author: António Fernandes <antoniof gnome org>
Date:   Wed Dec 15 20:06:05 2021 +0000

    general: Stop using GEmblemedIcon
    
    GTK 4 is not going to draw them anyway.
    
    Assume a temporary regression, to be fixed after the switch to GTK 4.

 src/nautilus-bookmark.c | 5 +++++
 src/nautilus-file.c     | 3 +++
 2 files changed, 8 insertions(+)
---
diff --git a/src/nautilus-bookmark.c b/src/nautilus-bookmark.c
index bc3c3bea7..036ad1691 100644
--- a/src/nautilus-bookmark.c
+++ b/src/nautilus-bookmark.c
@@ -172,6 +172,10 @@ static void
 apply_warning_emblem (GIcon    **base,
                       gboolean   symbolic)
 {
+/* GTK 4 doesn't draw emblemed icons. Use the warning icon itself. */
+    g_set_object (base, g_themed_icon_new (symbolic ? "dialog-warning-symbolic" : "dialog-warning"));
+
+#if 0
     GIcon *emblemed_icon;
     g_autoptr (GIcon) warning = NULL;
     g_autoptr (GEmblem) emblem = NULL;
@@ -191,6 +195,7 @@ apply_warning_emblem (GIcon    **base,
     g_object_unref (*base);
 
     *base = emblemed_icon;
+#endif
 }
 
 gboolean
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index b223299b5..9e08ded9c 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5036,6 +5036,8 @@ apply_emblems_to_icon (NautilusFile           *file,
 
     emblems = nautilus_file_get_emblem_icons (file);
 
+/* FIXME: GTK 4 doesn't draw emblemed icons. No op.*/
+#if 0
     for (GList *l = emblems; l != NULL; l = l->next)
     {
         g_autoptr (GEmblem) emblem = NULL;
@@ -5068,6 +5070,7 @@ apply_emblems_to_icon (NautilusFile           *file,
         g_object_unref (*icon);
         *icon = emblemed_icon;
     }
+#endif
 }
 
 GIcon *


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