summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <alexm@gnome.org>2020-11-16 12:23:57 +0500
committerAlexander Mikhaylenko <alexm@gnome.org>2020-11-16 18:13:26 +0500
commit36ade6b01cf2084a26b453a1dc3f8ce0a77daf56 (patch)
treeb14edb5f1e60fb1c86e272e0935db8087adfd829
parent54e995d605fb09fbb355b39c169ed5ebeac1b4e8 (diff)
downloadepiphany-wip/exalm/scale.tar.gz
action-bar-start: Support HiDPI for history menu iconswip/exalm/scale
-rw-r--r--src/ephy-action-bar-start.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/ephy-action-bar-start.c b/src/ephy-action-bar-start.c
index 2ebd3c559..816dc5da3 100644
--- a/src/ephy-action-bar-start.c
+++ b/src/ephy-action-bar-start.c
@@ -106,23 +106,14 @@ icon_loaded_cb (GObject *source,
cairo_surface_t *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);
+ gint scale = gtk_widget_get_scale_factor (image);
+
+ favicon = ephy_pixbuf_get_from_surface_scaled (icon_surface, FAVICON_SIZE * scale, FAVICON_SIZE * scale);
cairo_surface_destroy (icon_surface);
}
- if (favicon) {
- cairo_surface_t *surface;
-
- surface = gdk_cairo_surface_create_from_pixbuf (favicon,
- 0,
- gtk_widget_get_window (GTK_WIDGET (image)));
- gtk_image_set_from_surface (GTK_IMAGE (image), surface);
-
- gtk_widget_show (image);
-
- cairo_surface_destroy (surface);
- g_object_unref (favicon);
- }
+ if (favicon)
+ gtk_image_set_from_gicon (GTK_IMAGE (image), G_ICON (favicon), GTK_ICON_SIZE_MENU);
g_object_unref (image);
}