[gnome-software/wip/show-metainfo-load-icons: 38/38] gs-details-page: Load icons for --show-metainfo app




commit b26581b4c205aba1d709a86a7131b77e2cdcc09c
Author: Milan Crha <mcrha redhat com>
Date:   Tue Aug 9 16:06:01 2022 +0200

    gs-details-page: Load icons for --show-metainfo app
    
    Loading remote icons for the --show-metainfo app, when no special
    icon is specified on the command line, allows to get closer experience
    for the shown app.

 src/gs-details-page.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index a6711f97a..f42260111 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -2767,6 +2767,18 @@ gs_details_page_metainfo_thread (GTask *task,
                g_autoptr(GIcon) icon = g_file_icon_new (icon_file);
                gs_icon_set_width (icon, (guint) -1);
                gs_app_add_icon (app, G_ICON (icon));
+       } else {
+               g_autoptr(SoupSession) soup_session = NULL;
+               guint maximum_icon_size;
+
+               /* Currently a 160px icon is needed for #GsFeatureTile, at most.
+                * The '2' is to pretend the hiDPI/GDK's scale factor is 2, to
+                * allow larger icons. The 'icons' plugin uses proper scale factor.
+                */
+               maximum_icon_size = 160 * 2;
+
+               soup_session = gs_build_soup_session ();
+               gs_app_ensure_icons_downloaded (app, soup_session, maximum_icon_size, cancellable);
        }
 
        gs_app_set_state (app, GS_APP_STATE_UNKNOWN);


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