diff options
author | monsta <[email protected]> | 2017-09-07 14:30:39 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-09-19 17:08:39 +0300 |
commit | 083132844b262e0fabfd3c734fe5d90521995c2d (patch) | |
tree | 220da1bbadf9cfe40fd1a99d5535fb6c2112bd82 /cpufreq/src/cpufreq-applet.c | |
parent | 29c3ce4408b6139b17e41a301fe47329de4c491b (diff) | |
download | mate-applets-083132844b262e0fabfd3c734fe5d90521995c2d.tar.bz2 mate-applets-083132844b262e0fabfd3c734fe5d90521995c2d.tar.xz |
cpufreq: refresh applet size on style change (e.g. font size)
Diffstat (limited to 'cpufreq/src/cpufreq-applet.c')
-rw-r--r-- | cpufreq/src/cpufreq-applet.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c index c401d2d0..92d1e3b7 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; @@ -569,6 +571,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) { |