[gnome-applets] cpufreq: reset max widths in style_updated
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] cpufreq: reset max widths in style_updated
- Date: Mon, 12 Mar 2018 12:04:51 +0000 (UTC)
commit f8fb68c95deebb2b9e8b4f8cad0eba8e7eded793
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Mar 12 02:37:37 2018 +0200
cpufreq: reset max widths in style_updated
cpufreq/src/cpufreq-applet.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c
index bcae9e6..76e7024 100644
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -167,6 +167,19 @@ cpufreq_applet_show_text_mode_get_type (void)
}
static void
+cpufreq_applet_style_updated (GtkWidget *widget)
+{
+ CPUFreqApplet *applet;
+
+ applet = CPUFREQ_APPLET (widget);
+ GTK_WIDGET_CLASS (cpufreq_applet_parent_class)->style_updated (widget);
+
+ applet->max_label_width = 0;
+ applet->max_perc_width = 0;
+ applet->max_unit_width = 0;
+}
+
+static void
cpufreq_applet_init (CPUFreqApplet *applet)
{
applet->prefs = NULL;
@@ -222,9 +235,10 @@ cpufreq_applet_class_init (CPUFreqAppletClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->dispose = cpufreq_applet_dispose;
-
+
widget_class->size_allocate = cpufreq_applet_size_allocate;
- widget_class->get_preferred_width = cpufreq_applet_get_preferred_width;
+ 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]