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




commit 3c977dcf51bdaaa23258a5da8f19a9c1a9ca2d6d
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     | 5 +++++
 2 files changed, 10 insertions(+)
---
diff --git a/src/nautilus-bookmark.c b/src/nautilus-bookmark.c
index f115f2487..083c59dc3 100644
--- a/src/nautilus-bookmark.c
+++ b/src/nautilus-bookmark.c
@@ -174,6 +174,7 @@ static void
 apply_warning_emblem (GIcon    **base,
                       gboolean   symbolic)
 {
+#if 0 && EMBLEMS_NEEDS_GTK4_REIMPLEMENTATION
     GIcon *emblemed_icon;
     g_autoptr (GIcon) warning = NULL;
     g_autoptr (GEmblem) emblem = NULL;
@@ -193,6 +194,10 @@ apply_warning_emblem (GIcon    **base,
     g_object_unref (*base);
 
     *base = emblemed_icon;
+#else
+    /* 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"));
+#endif
 }
 
 gboolean
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index ca5a5cc1b..8dda72e10 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -4967,6 +4967,7 @@ nautilus_file_get_keywords (NautilusFile *file)
     return sort_keyword_list_and_remove_duplicates (keywords);
 }
 
+#if 0 && EMBLEMS_NEEDS_GTK4_REIMPLEMENTATION
 /**
  * nautilus_file_get_emblem_icons
  *
@@ -5019,6 +5020,7 @@ nautilus_file_get_emblem_icons (NautilusFile *file)
 
     return icons;
 }
+#endif
 
 static void
 prepend_icon_name (const char  *name,
@@ -5032,7 +5034,9 @@ apply_emblems_to_icon (NautilusFile           *file,
                        GIcon                 **icon,
                        NautilusFileIconFlags   flags)
 {
+#if 0 && EMBLEMS_NEEDS_GTK4_REIMPLEMENTATION
     GIcon *emblemed_icon = NULL;
+
     g_autolist (GIcon) emblems = NULL;
 
     emblems = nautilus_file_get_emblem_icons (file);
@@ -5069,6 +5073,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]