[nautilus/wip/antoniof/gtk4-pre-switch-regressions: 3/7] general: Stop using GEmblemedIcon




commit b5d584d2b22c7e2f8ed27c94ac64725386d2f9ac
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 f115f2487..8b3086671 100644
--- a/src/nautilus-bookmark.c
+++ b/src/nautilus-bookmark.c
@@ -174,6 +174,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;
@@ -193,6 +197,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 d0a9a8d03..ae18a4714 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5037,6 +5037,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;
@@ -5069,6 +5071,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]