aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/e-composer-header.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c
index c5b710830a..334464eddd 100644
--- a/composer/e-composer-header.c
+++ b/composer/e-composer-header.c
@@ -106,15 +106,21 @@ composer_header_constructor (GType type,
GtkWidget *box, *tmp;
gchar *str;
+ 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);
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 %s</span>", _("Show"), header->priv->addaction_text);
+ g_object_set_data ((GObject *)header->priv->action_label, "add", tmp);
+ tmp = gtk_image_new_from_stock("gtk-remove", GTK_ICON_SIZE_BUTTON);
+ gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3);
+ g_object_set_data ((GObject *)header->priv->action_label, "remove", tmp);
+ gtk_widget_hide (tmp);
+ tmp = header->priv->action_label;
+ str = g_strdup_printf ("<span>%s %s</span>", _("Show"), header->priv->addaction_text);
g_object_set_data ((GObject *)tmp, "show", str);
gtk_label_set_markup((GtkLabel *)tmp, str);
- str = g_strdup_printf ("<span foreground='blue' underline='single' underline_color='blue' >%s %s</span>", _("Hide"), header->priv->addaction_text);
+ str = g_strdup_printf ("<span>%s %s</span>", _("Hide"), header->priv->addaction_text);
g_object_set_data ((GObject *)tmp, "hide", str);
header->priv->action_label = tmp;
@@ -429,10 +435,16 @@ e_composer_header_set_visible (EComposerHeader *header,
header->priv->visible = visible;
if (header->priv->action_label) {
- if (!visible)
+ if (!visible) {
gtk_label_set_markup ((GtkLabel *)header->priv->action_label, g_object_get_data ((GObject *)header->priv->action_label, "show"));
- else
+ 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"));
+ }
}
g_object_notify (G_OBJECT (header), "visible");
}