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




commit 3210748b4067c5a005f7ff7400b1f90c140a623d
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 9498e81e4..ab32881ac 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]