From 5b1e05dbf5448251ea0dffc727233e52a2c2e518 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Wed, 3 Jun 2009 19:43:06 +0530 Subject: Anjal stuff's for Evo. --- composer/e-composer-header-table.c | 4 ++-- composer/e-composer-header.c | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index 542a836dc8..b47a15b115 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -944,13 +944,13 @@ composer_header_table_init (EComposerHeaderTable *table) table->priv->headers[E_COMPOSER_HEADER_TO] = header; header = e_composer_name_header_new_with_action ( - _("_Cc:"), _("Show CC"), name_selector); + _("_Cc:"), _("CC"), name_selector); e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_CC); composer_header_table_bind_header ("destinations-cc", "changed", header); table->priv->headers[E_COMPOSER_HEADER_CC] = header; header = e_composer_name_header_new_with_action ( - _("_Bcc:"), _("Show BCC"), name_selector); + _("_Bcc:"), _("BCC"), name_selector); e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_BCC); composer_header_table_bind_header ("destinations-bcc", "changed", header); table->priv->headers[E_COMPOSER_HEADER_BCC] = header; diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c index d679bdd263..f57d569ead 100644 --- a/composer/e-composer-header.c +++ b/composer/e-composer-header.c @@ -21,7 +21,7 @@ */ #include "e-composer-header.h" - +#include #define E_COMPOSER_HEADER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_COMPOSER_HEADER, EComposerHeaderPrivate)) @@ -47,6 +47,7 @@ struct _EComposerHeaderPrivate { gboolean button; gchar *addaction_text; gboolean addaction; /*For Add button.*/ + GtkWidget *action_label; guint sensitive : 1; guint visible : 1; @@ -67,8 +68,13 @@ static void composer_header_addaction_clicked_cb (GtkButton *button, EComposerHeader *header) { - gtk_widget_hide ((GtkWidget *)button); - e_composer_header_set_visible (header, TRUE); + gboolean show = !e_composer_header_get_visible(header); + if (!show) + gtk_label_set_markup ((GtkLabel *)header->priv->action_label, g_object_get_data ((GObject *)header->priv->action_label, "show")); + else + gtk_label_set_markup ((GtkLabel *)header->priv->action_label, g_object_get_data ((GObject *)header->priv->action_label, "hide")); + + e_composer_header_set_visible (header, show); } static GObject * @@ -108,8 +114,13 @@ composer_header_constructor (GType type, tmp = gtk_image_new_from_stock("gtk-add", GTK_ICON_SIZE_BUTTON); gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3); tmp = gtk_label_new (NULL); - str = g_strdup_printf ("%s", header->priv->addaction_text); + str = g_strdup_printf ("%s %s", _("Show"), header->priv->addaction_text); + g_object_set_data ((GObject *)tmp, "show", str); gtk_label_set_markup((GtkLabel *)tmp, str); + str = g_strdup_printf ("%s %s", _("Hide"), header->priv->addaction_text); + g_object_set_data ((GObject *)tmp, "hide", str); + + header->priv->action_label = tmp; gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3); gtk_container_add((GtkContainer *)header->action_widget, box); gtk_widget_show_all(header->action_widget); -- cgit v1.2.3