aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-datetime.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-01 16:30:44 -0600
committerTed Gould <ted@gould.cx>2010-03-01 16:30:44 -0600
commita526efc84112318aff7132f31051656bfd7b2eca (patch)
treeab36674a03d455d89e8b13546d683bb54066eac5 /src/indicator-datetime.c
parent303bc1f32c9bbc5d23dcc712a3c8dff31a338aa6 (diff)
downloadayatana-indicator-datetime-a526efc84112318aff7132f31051656bfd7b2eca.tar.gz
ayatana-indicator-datetime-a526efc84112318aff7132f31051656bfd7b2eca.tar.bz2
ayatana-indicator-datetime-a526efc84112318aff7132f31051656bfd7b2eca.zip
Reacting to changes in style.
Diffstat (limited to 'src/indicator-datetime.c')
-rw-r--r--src/indicator-datetime.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index d1a2db4..3fe11a3 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -275,6 +275,18 @@ guess_label_size (IndicatorDatetime * self)
return;
}
+/* React to the style changing, which could mean an font
+ update. */
+static void
+style_changed (GtkWidget * widget, GtkStyle * oldstyle, gpointer data)
+{
+ g_debug("New style for time label");
+ IndicatorDatetime * self = INDICATOR_DATETIME(data);
+ guess_label_size(self);
+ update_label(self);
+ return;
+}
+
/* Grabs the label. Creates it if it doesn't
exist already */
static GtkLabel *
@@ -286,6 +298,7 @@ get_label (IndicatorObject * io)
if (self->priv->label == NULL) {
self->priv->label = GTK_LABEL(gtk_label_new("Time"));
g_object_ref(G_OBJECT(self->priv->label));
+ g_signal_connect(G_OBJECT(self->priv->label), "style-set", G_CALLBACK(style_changed), self);
guess_label_size(self);
update_label(self);
gtk_widget_show(GTK_WIDGET(self->priv->label));