[epiphany/wip/exalm/hidpi-icons: 1/2] history-dialog: Fix blurry favicons on hidpi




commit e86f22b3292b431c9c99340d845271312fcbad2b
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Mar 28 14:18:55 2022 +0400

    history-dialog: Fix blurry favicons on hidpi
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1101>

 src/ephy-history-dialog.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-history-dialog.c b/src/ephy-history-dialog.c
index bbcf34af7..251601a8c 100644
--- a/src/ephy-history-dialog.c
+++ b/src/ephy-history-dialog.c
@@ -435,12 +435,14 @@ ephy_history_dialog_row_favicon_loaded_cb (GObject      *source,
     return;
 
   if (icon_surface) {
-    favicon = ephy_pixbuf_get_from_surface_scaled (icon_surface, FAVICON_SIZE, FAVICON_SIZE);
+    int scale = gtk_widget_get_scale_factor (icon);
+
+    favicon = ephy_pixbuf_get_from_surface_scaled (icon_surface, FAVICON_SIZE * scale, FAVICON_SIZE * scale);
     cairo_surface_destroy (icon_surface);
   }
 
   if (favicon && icon)
-    gtk_image_set_from_pixbuf (GTK_IMAGE (icon), favicon);
+    gtk_image_set_from_gicon (GTK_IMAGE (icon), G_ICON (favicon), GTK_ICON_SIZE_BUTTON);
 }
 
 static GtkWidget *
@@ -465,6 +467,7 @@ create_row (EphyHistoryDialog *self,
 
   /* Fav Icon */
   icon = gtk_image_new ();
+  gtk_image_set_pixel_size (GTK_IMAGE (icon), 16);
   hdy_action_row_add_prefix (HDY_ACTION_ROW (row), icon);
 
   database = webkit_web_context_get_favicon_database (ephy_embed_shell_get_web_context (shell));


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