diff options
Diffstat (limited to 'composer')
-rw-r--r-- | composer/e-composer-from-header.c | 10 | ||||
-rw-r--r-- | composer/e-composer-from-header.h | 3 | ||||
-rw-r--r-- | composer/e-composer-header-table.c | 71 | ||||
-rw-r--r-- | composer/e-composer-header.c | 11 | ||||
-rw-r--r-- | composer/e-composer-private.c | 4 | ||||
-rw-r--r-- | composer/e-composer-private.h | 1 |
6 files changed, 74 insertions, 26 deletions
diff --git a/composer/e-composer-from-header.c b/composer/e-composer-from-header.c index 4dadfa7ac7..cade5bfed3 100644 --- a/composer/e-composer-from-header.c +++ b/composer/e-composer-from-header.c @@ -110,6 +110,16 @@ e_composer_from_header_new (const gchar *label) "button", FALSE, NULL); } +EComposerHeader * +e_composer_from_header_new_with_action (const gchar *label, + const gchar *action) +{ + return g_object_new ( + E_TYPE_COMPOSER_FROM_HEADER, "label", label, + "button", FALSE, "addaction_text", action, + "addaction", action != NULL, NULL); +} + EAccountList * e_composer_from_header_get_account_list (EComposerFromHeader *header) { diff --git a/composer/e-composer-from-header.h b/composer/e-composer-from-header.h index d2603bd664..9f9a0e0f82 100644 --- a/composer/e-composer-from-header.h +++ b/composer/e-composer-from-header.h @@ -63,6 +63,9 @@ struct _EComposerFromHeaderClass { GType e_composer_from_header_get_type (void); EComposerHeader * e_composer_from_header_new (const gchar *label); +EComposerHeader * e_composer_from_header_new_with_action + (const gchar *label, + const gchar *action); EAccountList * e_composer_from_header_get_account_list (EComposerFromHeader *header); void e_composer_from_header_set_account_list diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index d883d8ecb2..47885df074 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -160,7 +160,11 @@ composer_header_table_notify_header (EComposerHeader *header, { GtkWidget *parent; - parent = gtk_widget_get_parent (header->input_widget); + if (strcmp (property_name, "destinations-to") == 0) + parent = g_object_get_data ( + G_OBJECT (header->input_widget), "parent"); + else + parent = gtk_widget_get_parent (header->input_widget); g_return_if_fail (E_IS_COMPOSER_HEADER_TABLE (parent)); g_object_notify (G_OBJECT (parent), property_name); } @@ -171,7 +175,11 @@ composer_header_table_notify_widget (GtkWidget *widget, { GtkWidget *parent; - parent = gtk_widget_get_parent (widget); + if (composer_lite) { + parent = gtk_widget_get_parent (widget); + parent = g_object_get_data (G_OBJECT (parent), "pdata"); + } else + parent = gtk_widget_get_parent (widget); g_return_if_fail (E_IS_COMPOSER_HEADER_TABLE (parent)); g_object_notify (G_OBJECT (parent), property_name); } @@ -502,9 +510,21 @@ composer_header_table_constructor (GType type, gtk_table_attach ( GTK_TABLE (object), priv->headers[ii]->title_widget, 0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 0, 3); - gtk_table_attach ( - GTK_TABLE (object), priv->headers[ii]->input_widget, - 1, 4, ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); + if (composer_lite && ii == E_COMPOSER_HEADER_TO) { + GtkWidget *box = gtk_hbox_new (FALSE, 0); + g_object_set_data ((GObject *)priv->headers[ii]->input_widget, "parent", object); + gtk_box_pack_start ((GtkBox *)box, priv->headers[ii]->input_widget, TRUE, TRUE, 3); + gtk_box_pack_start ((GtkBox *)box, (GtkWidget *)priv->actions_container, FALSE, FALSE, 0); + gtk_widget_show (box); + gtk_table_attach ( + GTK_TABLE (object), box, + 1, 4, ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); + + } else { + gtk_table_attach ( + GTK_TABLE (object), priv->headers[ii]->input_widget, + 1, 4, ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); + } if (composer_lite && priv->headers[ii]->action_widget) { /* Pack the widgets to the end. Helps formatting when hiding the From field */ gtk_box_pack_end ((GtkBox *)priv->actions_container, priv->headers[ii]->action_widget, @@ -531,24 +551,27 @@ composer_header_table_constructor (GType type, G_OBJECT (priv->signature_combo_box), "visible"); /* Now add the signature stuff. */ - gtk_table_attach ( - GTK_TABLE (object), priv->signature_label, - 2, 3, ii, ii + 1, 0, 0, 0, 3); - gtk_table_attach ( - GTK_TABLE (object), priv->signature_combo_box, - 3, 4, ii, ii + 1, 0, 0, 0, 3); - - if (composer_lite) { - ii = E_COMPOSER_HEADER_TO; - - /* Leave room for the action buttons. */ - gtk_container_child_set ( - GTK_CONTAINER (object), - priv->headers[ii]->input_widget, - "right-attach", 2, NULL); - - gtk_table_attach (GTK_TABLE (object), (GtkWidget *)priv->actions_container, 2, 4, E_COMPOSER_HEADER_TO, - E_COMPOSER_HEADER_TO + 1, GTK_FILL, 0, 0, 3); + if (!composer_lite) { + gtk_table_attach ( + GTK_TABLE (object), priv->signature_label, + 2, 3, ii, ii + 1, 0, 0, 0, 3); + gtk_table_attach ( + GTK_TABLE (object), priv->signature_combo_box, + 3, 4, ii, ii + 1, composer_lite ? GTK_FILL: 0, 0, 0, 3); + } else { + GtkWidget *box = gtk_hbox_new (FALSE, 0); + + gtk_box_pack_start ( + GTK_BOX (box), priv->signature_label, + FALSE, FALSE, 4); + gtk_box_pack_end ( + GTK_BOX (box), priv->signature_combo_box, + TRUE, TRUE, 0); + g_object_set_data (G_OBJECT (box), "pdata", object); + gtk_table_attach ( + GTK_TABLE (object), box, + 3, 4, ii, ii + 1, GTK_FILL, 0, 0, 3); + gtk_widget_hide (box); } return object; @@ -923,7 +946,7 @@ composer_header_table_init (EComposerHeaderTable *table) table->priv->actions_container = (GtkHBox *)gtk_hbox_new (FALSE, 6); - header = e_composer_from_header_new (_("Fr_om:")); + header = e_composer_from_header_new_with_action (_("Fr_om:"), _("From")); composer_header_table_bind_header ("account", "changed", header); composer_header_table_bind_header ("account-list", "refreshed", header); composer_header_table_bind_header ("account-name", "changed", header); diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c index dd274c4b88..fd71bab4d9 100644 --- a/composer/e-composer-header.c +++ b/composer/e-composer-header.c @@ -106,6 +106,7 @@ 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); @@ -426,10 +427,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"); } diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index 5613670b13..bfb14b451a 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -164,6 +164,10 @@ e_composer_private_init (EMsgComposer *composer) /* Construct the attachment paned. */ + if (composer->lite) { + e_attachment_paned_set_default_height (75); /* short attachment bar for Anjal */ + e_attachment_icon_view_set_default_icon_size (GTK_ICON_SIZE_BUTTON); + } widget = e_attachment_paned_new (); gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); priv->attachment_paned = g_object_ref (widget); diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h index 3d8a1b9f95..1d0c19f366 100644 --- a/composer/e-composer-private.h +++ b/composer/e-composer-private.h @@ -32,6 +32,7 @@ #include "e-util/e-charset.h" #include "e-util/e-util.h" #include "e-util/gconf-bridge.h" +#include "widgets/misc/e-attachment-icon-view.h" #include "widgets/misc/e-attachment-paned.h" #include "widgets/misc/e-attachment-store.h" |