From 42cedf78e5e40846d426a2a56b390d225f1ecc80 Mon Sep 17 00:00:00 2001 From: monsta Date: Thu, 7 Sep 2017 14:30:39 +0300 Subject: cpufreq: refresh applet size on style change (e.g. font size) --- cpufreq/src/cpufreq-applet.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c index 407d78e4..94f54b2b 100644 --- a/cpufreq/src/cpufreq-applet.c +++ b/cpufreq/src/cpufreq-applet.c @@ -107,6 +107,7 @@ static void cpufreq_applet_get_preferred_width (GtkWidget *widget, gint *natural_width); static void cpufreq_applet_change_orient (MatePanelApplet *pa, MatePanelAppletOrient orient); +static void cpufreq_applet_style_updated (GtkWidget *widget); static gboolean cpufreq_applet_factory (CPUFreqApplet *applet, const gchar *iid, gpointer gdata); @@ -221,6 +222,7 @@ cpufreq_applet_class_init (CPUFreqAppletClass *klass) gobject_class->dispose = cpufreq_applet_dispose; widget_class->size_allocate = cpufreq_applet_size_allocate; + widget_class->style_updated = cpufreq_applet_style_updated; widget_class->get_preferred_width = cpufreq_applet_get_preferred_width; widget_class->button_press_event = cpufreq_applet_button_press; widget_class->key_press_event = cpufreq_applet_key_press; @@ -563,6 +565,20 @@ cpufreq_applet_change_orient (MatePanelApplet *pa, MatePanelAppletOrient orient) } } +static void +cpufreq_applet_style_updated (GtkWidget *widget) +{ + CPUFreqApplet *applet; + + applet = CPUFREQ_APPLET (widget); + + applet->max_label_width = 0; + applet->max_unit_width = 0; + applet->max_perc_width = 0; + + cpufreq_applet_refresh (applet); +} + static void cpufreq_applet_preferences_cb (GtkAction *action, CPUFreqApplet *applet) -- cgit v1.2.1