aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-dialpad-button.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-06 21:04:55 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-09 15:48:33 +0800
commitcc26255d60d53c56e42dffd8094d028d7cde112f (patch)
tree5287325bad3ddcc7d3bf319c97a79cba229a8b6e /libempathy-gtk/empathy-dialpad-button.c
parent086cd424968bc5c4ef97f3b715bd26fd2a46e9ec (diff)
downloadgsoc2013-empathy-cc26255d60d53c56e42dffd8094d028d7cde112f.tar
gsoc2013-empathy-cc26255d60d53c56e42dffd8094d028d7cde112f.tar.gz
gsoc2013-empathy-cc26255d60d53c56e42dffd8094d028d7cde112f.tar.bz2
gsoc2013-empathy-cc26255d60d53c56e42dffd8094d028d7cde112f.tar.lz
gsoc2013-empathy-cc26255d60d53c56e42dffd8094d028d7cde112f.tar.xz
gsoc2013-empathy-cc26255d60d53c56e42dffd8094d028d7cde112f.tar.zst
gsoc2013-empathy-cc26255d60d53c56e42dffd8094d028d7cde112f.zip
dialpad-widget: use EmpathyDialpadButton
This will be needed if we want to stop using GtkButton in order to keep the key pressed while the keyboard key is. Anyway, it's good to have regardeless as that makes the code cleaner. https://bugzilla.gnome.org/show_bug.cgi?id=679396
Diffstat (limited to 'libempathy-gtk/empathy-dialpad-button.c')
-rw-r--r--libempathy-gtk/empathy-dialpad-button.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-dialpad-button.c b/libempathy-gtk/empathy-dialpad-button.c
index 0378401c1..bddf42bf2 100644
--- a/libempathy-gtk/empathy-dialpad-button.c
+++ b/libempathy-gtk/empathy-dialpad-button.c
@@ -109,10 +109,36 @@ empathy_dialpad_button_constructed (GObject *object)
EmpathyDialpadButton *self = EMPATHY_DIALPAD_BUTTON (object);
void (*chain_up) (GObject *) =
((GObjectClass *) empathy_dialpad_button_parent_class)->constructed;
+ GtkWidget *vbox;
+ GtkWidget *label;
+ gchar *str;
g_assert (self->priv->label != NULL);
g_assert (self->priv->sub_label != NULL);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+
+ gtk_container_add (GTK_CONTAINER (self), vbox);
+
+ /* main label */
+ label = gtk_label_new ("");
+ str = g_strdup_printf ("<span size='x-large'>%s</span>",
+ self->priv->label);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ g_free (str);
+
+ gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 3);
+
+ /* sub label */
+ label = gtk_label_new ("");
+ str = g_strdup_printf (
+ "<span foreground='#555555'>%s</span>",
+ self->priv->sub_label);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ g_free (str);
+
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
+
if (chain_up != NULL)
chain_up (object);
}