From: Jose Dapena Paz Date: Mon, 19 Jan 2009 10:44:27 +0000 (+0000) Subject: Added new method to set a new label on captioned X-Git-Tag: git_migration_finished~782 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=00ae0c2e5c1602c2f8b83efbb753a7c174e0e19a Added new method to set a new label on captioned pmo-trunk-r7171 --- diff --git a/src/hildon2/modest-maemo-utils.c b/src/hildon2/modest-maemo-utils.c index 00a3dbe..585f35b 100644 --- a/src/hildon2/modest-maemo-utils.c +++ b/src/hildon2/modest-maemo-utils.c @@ -68,6 +68,9 @@ #define BTNAME_MATCH_RULE "type='signal',interface='" BTNAME_SIGNAL_IF \ "',member='" BTNAME_SIG_CHANGED "'" +/* Label child of a captioned */ +#define CAPTIONED_LABEL_CHILD "captioned-label" + static osso_context_t *__osso_context = NULL; /* urgh global */ @@ -363,10 +366,39 @@ modest_maemo_utils_create_captioned_with_size_type (GtkSizeGroup *title_size_ hildon_gtk_widget_set_theme_size (control, size_type); + g_object_set_data (G_OBJECT (box), CAPTIONED_LABEL_CHILD, label); + return box; } /** + * modest_maemo_utils_captioned_set_label: + * @captioned: a #GtkWidget built as captioned + * @new_label: a string + * @use_markup: a #gboolean + * + * set a new label for the captioned + */ +void +modest_maemo_utils_captioned_set_label (GtkWidget *captioned, + const gchar *new_label, + gboolean use_markup) +{ + GtkWidget *label; + + g_return_if_fail (GTK_IS_WIDGET (captioned)); + + label = g_object_get_data (G_OBJECT (captioned), CAPTIONED_LABEL_CHILD); + g_return_if_fail (GTK_IS_LABEL (label)); + + if (use_markup) { + gtk_label_set_markup (GTK_LABEL (label), new_label); + } else { + gtk_label_set_text (GTK_LABEL (label), new_label); + } +} + +/** * modest_maemo_utils_set_hbutton_layout: * @title_sizegroup: a #GtkSizeGroup, or %NULL * @value_sizegroup: a #GtkSizeGroup, or %NULL diff --git a/src/hildon2/modest-maemo-utils.h b/src/hildon2/modest-maemo-utils.h index c5777a1..bd679c7 100644 --- a/src/hildon2/modest-maemo-utils.h +++ b/src/hildon2/modest-maemo-utils.h @@ -137,6 +137,10 @@ GtkWidget *modest_maemo_utils_create_captioned_with_size_type (GtkSizeGroup * GtkWidget *control, HildonSizeType size_type); +void modest_maemo_utils_captioned_set_label (GtkWidget *captioned, + const gchar *new_label, + gboolean use_markup); + void modest_maemo_utils_set_hbutton_layout (GtkSizeGroup *title_sizegroup, GtkSizeGroup *value_sizegroup, const gchar *title,