[epiphany/wip/exalm/hidpi-icons: 2/2] bookmark-row: Fix blurry favicons on hidpi
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/exalm/hidpi-icons: 2/2] bookmark-row: Fix blurry favicons on hidpi
- Date: Mon, 28 Mar 2022 10:19:25 +0000 (UTC)
commit 8b093e661bd9f340a7c458bc900b4cba1cdbeb2b
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Mon Mar 28 14:19:09 2022 +0400
bookmark-row: Fix blurry favicons on hidpi
src/bookmarks/ephy-bookmark-row.c | 6 ++++--
src/resources/gtk/bookmark-row.ui | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmark-row.c b/src/bookmarks/ephy-bookmark-row.c
index 5caef810c..7a72705d2 100644
--- a/src/bookmarks/ephy-bookmark-row.c
+++ b/src/bookmarks/ephy-bookmark-row.c
@@ -92,13 +92,15 @@ ephy_bookmark_row_favicon_loaded_cb (GObject *source,
icon_surface = webkit_favicon_database_get_favicon_finish (database, result, NULL);
if (icon_surface) {
- favicon = ephy_pixbuf_get_from_surface_scaled (icon_surface, FAVICON_SIZE, FAVICON_SIZE);
+ int scale = gtk_widget_get_scale_factor (self->favicon_image);
+
+ favicon = ephy_pixbuf_get_from_surface_scaled (icon_surface, FAVICON_SIZE * scale, FAVICON_SIZE * scale);
cairo_surface_destroy (icon_surface);
}
if (favicon) {
if (self->favicon_image != NULL)
- gtk_image_set_from_pixbuf (GTK_IMAGE (self->favicon_image), favicon);
+ gtk_image_set_from_gicon (GTK_IMAGE (self->favicon_image), G_ICON (favicon), GTK_ICON_SIZE_BUTTON);
}
}
diff --git a/src/resources/gtk/bookmark-row.ui b/src/resources/gtk/bookmark-row.ui
index b3f29d8de..03fe6c3d6 100644
--- a/src/resources/gtk/bookmark-row.ui
+++ b/src/resources/gtk/bookmark-row.ui
@@ -12,6 +12,7 @@
<object class="GtkImage" id="favicon_image">
<property name="visible">True</property>
<property name="margin-start">6</property>
+ <property name="pixel-size">16</property>
</object>
</child>
<child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]