[gnome-builder] gui: Bind frame popover open pages icon by gicon instead of icon-name



commit dd4b855071e3788aab8edab6bf322d8eee9de6f0
Author: vanadiae <vanadiae35 gmail com>
Date:   Sun Apr 11 22:39:07 2021 +0200

    gui: Bind frame popover open pages icon by gicon instead of icon-name
    
    Currently editor pages have their page icon set to the one found for
    the corresponding MIME type of the file.
    
    While those icons are correctly shown under "Opened Pages" in the left
    sidebar, they are only shown with the default text/plain MIME icon in the
    frame header's Open Pages popover, so per-MIME type icon support is left
    unfinished.
    
    So this commit fixes it by changing from a binding of the icon-name
    to a binding of the (g)icon, because the icon-name property is only a
    shorthand to set the gicon, but icons at the end of the day are always
    set in the (g)icon property even when setting icon-name. This is
    especially important since ide_g_content_type_get_symbolic_icon gives a
    GIcon, not an icon name. That's why editor pages were shown with the
    text/plain MIME icon in the popover, as the icon was first set with
    icon-name before setting it with the gicon associated with the file's
    MIME type.

 src/libide/gui/ide-frame-header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libide/gui/ide-frame-header.c b/src/libide/gui/ide-frame-header.c
index 8a305822f..824fc5efc 100644
--- a/src/libide/gui/ide-frame-header.c
+++ b/src/libide/gui/ide-frame-header.c
@@ -282,7 +282,7 @@ create_document_row (gpointer item,
                            self, 0);
   dzl_gtk_widget_add_style_class (GTK_WIDGET (close_button), "image-button");
 
-  g_object_bind_property (item, "icon-name", image, "icon-name", G_BINDING_SYNC_CREATE);
+  g_object_bind_property (item, "icon", image, "gicon", G_BINDING_SYNC_CREATE);
   g_object_bind_property_full (item, "modified", label, "attributes", G_BINDING_SYNC_CREATE,
                                modified_to_attrs, NULL, NULL, NULL);
   g_object_bind_property (item, "title", label, "label", G_BINDING_SYNC_CREATE);


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