From 1550eff338a1194a90f3ad2948e4f381098c8a20 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Mon, 20 Jul 2009 17:56:18 +0530 Subject: Add option to hide 'From' for Anjal. --- composer/e-composer-from-header.c | 8 ++++++++ composer/e-composer-from-header.h | 1 + composer/e-composer-header-table.c | 31 +++++++++++++++++++++++-------- 3 files changed, 32 insertions(+), 8 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-from-header.c b/composer/e-composer-from-header.c index 4dadfa7ac7..e7963666f3 100644 --- a/composer/e-composer-from-header.c +++ b/composer/e-composer-from-header.c @@ -110,6 +110,14 @@ e_composer_from_header_new (const gchar *label) "button", FALSE, NULL); } +EComposerHeader * +e_composer_from_header_new_with_action (const gchar *label, const char *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..cf360693aa 100644 --- a/composer/e-composer-from-header.h +++ b/composer/e-composer-from-header.h @@ -63,6 +63,7 @@ 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 char *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 b47a15b115..cbb0185c16 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -171,7 +171,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 ((GObject *)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); } @@ -532,12 +536,23 @@ 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) { + 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 ((GtkBox *)box, priv->signature_label, FALSE, FALSE, 4); + gtk_box_pack_end ((GtkBox *)box, priv->signature_combo_box, TRUE, TRUE, 0); + g_object_set_data ((GObject *)box, "pdata", object); + gtk_table_attach ( + GTK_TABLE (object), box, + 3, 4, ii, ii + 1, GTK_FILL, 0, 0, 3); + gtk_widget_show (box); + } if (composer_lite) { ii = E_COMPOSER_HEADER_TO; @@ -924,7 +939,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); -- cgit v1.2.3 From e730108e2078e24b878b4af53295a8058df5f3a4 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Mon, 20 Jul 2009 18:15:16 +0530 Subject: Fix composer string for Anjal. --- composer/e-composer-header.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'composer') 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 ("%s %s", _("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 ("%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); + str = g_strdup_printf ("%s %s", _("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"); } -- cgit v1.2.3 From 631da1b6baf2204ebb844a1d3962c2c7d811eb41 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Wed, 22 Jul 2009 19:05:05 +0530 Subject: Fix composer for Anjal. --- composer/e-composer-header-table.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index cbb0185c16..2b040628a0 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -506,9 +506,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); + + 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, @@ -551,20 +563,7 @@ composer_header_table_constructor (GType type, gtk_table_attach ( GTK_TABLE (object), box, 3, 4, ii, ii + 1, GTK_FILL, 0, 0, 3); - gtk_widget_show (box); - } - - 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); + gtk_widget_hide (box); } return object; -- cgit v1.2.3 From 5d4e8994e83c9ab650981c332eaef57f4fab2788 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Thu, 23 Jul 2009 14:26:45 +0530 Subject: Fix a crit warning for Anjal --- composer/e-composer-header-table.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index 2b040628a0..ed999bf019 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((GObject *)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); } @@ -508,7 +512,7 @@ composer_header_table_constructor (GType type, 0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 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); -- cgit v1.2.3 From 55978f863a5c51797881dfe8fd69ca862d60b70c Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 24 Jul 2009 08:20:14 +0530 Subject: Fix Attachment bar size of Anjal. --- composer/e-composer-private.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'composer') diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index e834f41b4e..7e79e0c895 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -162,6 +162,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); -- cgit v1.2.3 From 2badc0e210b278304970f1471124eb1c25423fff Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 24 Jul 2009 10:47:44 +0530 Subject: Fix a warning --- composer/e-composer-private.c | 1 + 1 file changed, 1 insertion(+) (limited to 'composer') diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index 7e79e0c895..9a506fa862 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -17,6 +17,7 @@ #include "e-composer-private.h" #include "e-util/e-util-private.h" +#include "widgets/misc/e-attachment-icon-view.h" static void composer_setup_charset_menu (EMsgComposer *composer) -- cgit v1.2.3 From 30ac043b6ef2ad85de31c8dfbd87ac5a63d58dd8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 26 Jul 2009 08:18:59 -0400 Subject: Coding style and whitespace cleanups. --- composer/e-composer-from-header.c | 2 +- composer/e-composer-from-header.h | 2 +- composer/e-composer-header-table.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-from-header.c b/composer/e-composer-from-header.c index e7963666f3..320768c79c 100644 --- a/composer/e-composer-from-header.c +++ b/composer/e-composer-from-header.c @@ -111,7 +111,7 @@ e_composer_from_header_new (const gchar *label) } EComposerHeader * -e_composer_from_header_new_with_action (const gchar *label, const char *action) +e_composer_from_header_new_with_action (const gchar *label, const gchar *action) { return g_object_new ( E_TYPE_COMPOSER_FROM_HEADER, "label", label, diff --git a/composer/e-composer-from-header.h b/composer/e-composer-from-header.h index cf360693aa..3fbf5a7012 100644 --- a/composer/e-composer-from-header.h +++ b/composer/e-composer-from-header.h @@ -63,7 +63,7 @@ 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 char *action); +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 ed999bf019..55dc6a65a0 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -519,7 +519,7 @@ composer_header_table_constructor (GType type, 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, -- cgit v1.2.3