summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-09-07 14:30:39 +0300
committermonsta <[email protected]>2017-09-22 15:52:28 +0300
commit42cedf78e5e40846d426a2a56b390d225f1ecc80 (patch)
tree652533307508cf9b4c581cf9f18c709801d261a5
parent6736bfd27523d69171045e35592111c38c109006 (diff)
downloadmate-applets-42cedf78e5e40846d426a2a56b390d225f1ecc80.tar.bz2
mate-applets-42cedf78e5e40846d426a2a56b390d225f1ecc80.tar.xz
cpufreq: refresh applet size on style change (e.g. font size)
-rw-r--r--cpufreq/src/cpufreq-applet.c16
1 files changed, 16 insertions, 0 deletions
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;
@@ -564,6 +566,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)
{