[metacity] theme-viewer: fix appmenu icon size



commit 1ca0273d2457b16d3d118482a06401511ac64f47
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed May 10 20:41:50 2017 +0300

    theme-viewer: fix appmenu icon size

 theme-viewer/theme-viewer-window.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/theme-viewer/theme-viewer-window.c b/theme-viewer/theme-viewer-window.c
index e00d2c3..2e56e34 100644
--- a/theme-viewer/theme-viewer-window.c
+++ b/theme-viewer/theme-viewer-window.c
@@ -286,7 +286,8 @@ update_frame_flags_sensitivity (ThemeViewerWindow *window)
 }
 
 static GdkPixbuf *
-get_icon (gint size)
+get_icon (ThemeViewerWindow *window,
+          gint               size)
 {
   GtkIconTheme *theme;
   const gchar *icon;
@@ -298,7 +299,9 @@ get_icon (gint size)
   else
     icon = "image-missing";
 
-  return gtk_icon_theme_load_icon (theme, icon, size, 0, NULL);;
+  return gtk_icon_theme_load_icon_for_scale (theme, icon, size,
+                                             window->scale,
+                                             0, NULL);
 }
 
 static void
@@ -729,10 +732,10 @@ theme_box_draw_cb (GtkWidget         *widget,
                                &client_width, &client_height);
 
   if (!window->mini_icon)
-    window->mini_icon = get_icon (MINI_ICON_SIZE);
+    window->mini_icon = get_icon (window, MINI_ICON_SIZE);
 
   if (!window->mini_icon)
-    window->icon = get_icon (ICON_SIZE);
+    window->icon = get_icon (window, ICON_SIZE);
 
   cairo_translate (cr, PADDING, PADDING);
 
@@ -863,6 +866,9 @@ scale_changed_cb (GtkSpinButton     *spin_button,
 
   meta_theme_set_scale (window->theme, scale);
 
+  g_clear_object (&window->mini_icon);
+  g_clear_object (&window->icon);
+
   update_frame_borders (window);
 
   gtk_widget_queue_draw (window->theme_box);


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