summaryrefslogtreecommitdiff
path: root/mate-volume-control/gvc-applet.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2019-02-07 18:27:37 -0500
committerlukefromdc <[email protected]>2019-02-26 01:48:56 -0500
commitd7257167fd0c007e8c29fd84a9be3ffe70d43c9d (patch)
tree2f96d23c269bb0cd8fdc26c37fbbf1296d4173bf /mate-volume-control/gvc-applet.c
parent5fd1ba21e41281195e39366061e0d9d0535df014 (diff)
downloadmate-media-d7257167fd0c007e8c29fd84a9be3ffe70d43c9d.tar.bz2
mate-media-d7257167fd0c007e8c29fd84a9be3ffe70d43c9d.tar.xz
Ensure volume icon is always correctly scaled
Correctly size and scale the icon so doesn't get rendered oversize/ cut at certain panel sizes or on first start. Also set the GTK_ICON_LOOKUP_FORCE_SIZE flag in gtk_icon_theme_load_surface so that when icon theme provides only a single scalable icon it renders the correct size. Otherwise such icons render seriously undersize.
Diffstat (limited to 'mate-volume-control/gvc-applet.c')
-rw-r--r--mate-volume-control/gvc-applet.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mate-volume-control/gvc-applet.c b/mate-volume-control/gvc-applet.c
index f39d989..2d91725 100644
--- a/mate-volume-control/gvc-applet.c
+++ b/mate-volume-control/gvc-applet.c
@@ -385,6 +385,18 @@ gvc_applet_set_size(GtkWidget* widget, int size, gpointer user_data)
{
GvcApplet *applet = user_data;
+ /*Iterate through the icon sizes so they can be kept sharp*/
+ if (size < 22)
+ size = 16;
+ else if (size < 24)
+ size = 22;
+ else if (size < 32)
+ size = 24;
+ else if (size < 48)
+ size = 32;
+ else
+ size = 48;
+
gvc_stream_status_icon_set_size (applet->priv->icon_input, size);
gvc_stream_status_icon_set_size (applet->priv->icon_output, size);
}