aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-12-17 23:55:07 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-12-17 23:55:07 +0800
commit12d86c1f7ad1ef5085b322f92ad49cc1e946c968 (patch)
tree52c706ffe0505d7cf7e6a349334f2287ef23c526
parent735496ba529daebea96e16ed7ed1b97f019eec62 (diff)
downloadgsoc2013-evolution-12d86c1f7ad1ef5085b322f92ad49cc1e946c968.tar.gz
gsoc2013-evolution-12d86c1f7ad1ef5085b322f92ad49cc1e946c968.tar.zst
gsoc2013-evolution-12d86c1f7ad1ef5085b322f92ad49cc1e946c968.zip
Merge some composer header changes for Anjal.
-rw-r--r--composer/e-composer-header-table.c4
-rw-r--r--composer/e-composer-header.c41
2 files changed, 31 insertions, 14 deletions
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index b23d386195..3486ab6f64 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -966,13 +966,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 f80a818cee..bd7cce7ab6 100644
--- a/composer/e-composer-header.c
+++ b/composer/e-composer-header.c
@@ -22,6 +22,8 @@
#include "e-composer-header.h"
+#include <glib/gi18n.h>
+
#define E_COMPOSER_HEADER_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_COMPOSER_HEADER, EComposerHeaderPrivate))
@@ -49,6 +51,11 @@ struct _EComposerHeaderPrivate {
gboolean addaction; /*For Add button.*/
GtkWidget *action_label;
+ GtkWidget *add_icon;
+ GtkWidget *remove_icon;
+ GtkWidget *show_label;
+ GtkWidget *hide_label;
+
guint sensitive : 1;
guint visible : 1;
};
@@ -109,13 +116,24 @@ composer_header_constructor (GType type,
header->priv->action_label = gtk_label_new (NULL);
header->action_widget = gtk_button_new ();
box = gtk_hbox_new (FALSE, 0);
- tmp = gtk_image_new_from_stock("gtk-add", GTK_ICON_SIZE_BUTTON);
+ tmp = gtk_image_new_from_stock(GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON);
+ header->priv->add_icon = tmp;
+ gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3);
+ tmp = gtk_image_new_from_stock(GTK_STOCK_REMOVE, GTK_ICON_SIZE_BUTTON);
+ header->priv->remove_icon = tmp;
gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3);
tmp = gtk_label_new (NULL);
- str = g_strdup_printf ("<span foreground='blue' underline='single' underline_color='blue' >%s</span>", header->priv->addaction_text);
+ str = g_strdup_printf ("<span>%s %s</span>", _("Show"), header->priv->addaction_text);
gtk_label_set_markup((GtkLabel *)tmp, str);
g_free (str);
+ header->priv->show_label = tmp;
gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3);
+ tmp = gtk_label_new (NULL);
+ str = g_strdup_printf ("<span>%s %s</span>", _("Hide"), header->priv->addaction_text);
+ gtk_label_set_markup((GtkLabel *)tmp, str);
+ header->priv->hide_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);
g_signal_connect (
@@ -427,20 +445,19 @@ e_composer_header_set_visible (EComposerHeader *header,
header->priv->visible = visible;
-#if 0 /* FIXME This is horrible. Needs completely rethought. */
if (header->priv->action_label) {
if (!visible) {
- gtk_label_set_markup ((GtkLabel *)header->priv->action_label, g_object_get_data ((GObject *)header->priv->action_label, "show"));
- gtk_widget_show (g_object_get_data((GObject *) header->priv->action_label, "add"));
- gtk_widget_hide (g_object_get_data((GObject *) header->priv->action_label, "remove"));
-
- }else {
- gtk_label_set_markup ((GtkLabel *)header->priv->action_label, g_object_get_data ((GObject *)header->priv->action_label, "hide"));
- gtk_widget_hide (g_object_get_data((GObject *) header->priv->action_label, "add"));
- gtk_widget_show (g_object_get_data((GObject *) header->priv->action_label, "remove"));
+ gtk_widget_show (header->priv->add_icon);
+ gtk_widget_show (header->priv->show_label);
+ gtk_widget_hide (header->priv->remove_icon);
+ gtk_widget_hide (header->priv->hide_label);
+ } else {
+ gtk_widget_hide (header->priv->add_icon);
+ gtk_widget_hide (header->priv->show_label);
+ gtk_widget_show (header->priv->remove_icon);
+ gtk_widget_show (header->priv->hide_label);
}
}
-#endif
g_object_notify (G_OBJECT (header), "visible");
}