X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-gtkhtml-msg-view.c;h=d8ebb46efc6ea8a90dcb03338a534bee1d03e9f1;hp=3bacb9b39bf4297fd35335347e7e562f6eb0a4dc;hb=e374da56f67092cecb1572dd4bee2ca34e0bc04c;hpb=004e051469e80cc145ee2fb886682bd1ff07b213 diff --git a/src/widgets/modest-gtkhtml-msg-view.c b/src/widgets/modest-gtkhtml-msg-view.c index 3bacb9b..d8ebb46 100644 --- a/src/widgets/modest-gtkhtml-msg-view.c +++ b/src/widgets/modest-gtkhtml-msg-view.c @@ -41,7 +41,12 @@ #include #include #include -#include +#ifdef MODEST_TOOLKIT_HILDON2 +#include +#include +#else +#include +#endif #include #include #include @@ -50,9 +55,9 @@ #include /* FIXNE: we should have no maemo-deps in widgets/ */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK #include "maemo/modest-hildon-includes.h" -#endif /*MODEST_PLATFORM_MAEMO*/ +#endif /*!MODEST_TOOLKIT_GTK*/ /* 'private'/'protected' functions */ @@ -71,6 +76,7 @@ static void get_property (GObject *object, guint prop_id, GValue *value, GPa /* headers signals */ static void on_recpt_activated (ModestMailHeaderView *header_view, const gchar *address, ModestGtkhtmlMsgView *msg_view); +static void on_show_details (ModestMailHeaderView *header_view, ModestGtkhtmlMsgView *msg_view); static void on_attachment_activated (ModestAttachmentsView * att_view, TnyMimePart *mime_part, gpointer userdata); static void on_view_images_clicked (GtkButton * button, gpointer self); @@ -1058,8 +1064,16 @@ modest_gtkhtml_msg_view_init (ModestGtkhtmlMsgView *obj) priv->msg = NULL; priv->body_view = GTK_WIDGET (g_object_new (MODEST_TYPE_GTKHTML_MIME_PART_VIEW, NULL)); - priv->mail_header_view = GTK_WIDGET(modest_mail_header_view_new (TRUE)); +#ifdef MODEST_TOOLKIT_HILDON2 + priv->mail_header_view = GTK_WIDGET(modest_compact_mail_header_view_new ()); +#else + priv->mail_header_view = GTK_WIDGET(modest_expander_mail_header_view_new (TRUE)); +#endif priv->view_images_button = gtk_button_new_with_label (_("mail_bd_external_images")); +#ifdef MODEST_TOOLKIT_HILDON2 + hildon_gtk_widget_set_theme_size (priv->view_images_button, + HILDON_SIZE_HALFSCREEN_WIDTH | HILDON_SIZE_FINGER_HEIGHT); +#endif gtk_widget_set_no_show_all (priv->mail_header_view, TRUE); gtk_widget_set_no_show_all (priv->view_images_button, TRUE); priv->attachments_view = GTK_WIDGET(modest_attachments_view_new (NULL)); @@ -1081,6 +1095,8 @@ modest_gtkhtml_msg_view_init (ModestGtkhtmlMsgView *obj) g_signal_connect (G_OBJECT (priv->mail_header_view), "recpt-activated", G_CALLBACK (on_recpt_activated), obj); + g_signal_connect (G_OBJECT (priv->mail_header_view), "show-details", + G_CALLBACK (on_show_details), obj); g_signal_connect (G_OBJECT (priv->attachments_view), "activate", G_CALLBACK (on_attachment_activated), obj); @@ -1105,7 +1121,12 @@ modest_gtkhtml_msg_view_init (ModestGtkhtmlMsgView *obj) hbuttonbox = gtk_hbutton_box_new (); gtk_container_add (GTK_CONTAINER (hbuttonbox), priv->view_images_button); +#ifdef MODEST_TOOLKIT_HILDON2 + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_START); + gtk_box_pack_start (GTK_BOX (priv->headers_box), hbuttonbox, TRUE, TRUE, 0); +#else gtk_box_pack_start (GTK_BOX (priv->headers_box), hbuttonbox, FALSE, FALSE, 0); +#endif gtk_widget_hide (priv->view_images_button); } @@ -1417,6 +1438,13 @@ on_recpt_activated (ModestMailHeaderView *header_view, } static void +on_show_details (ModestMailHeaderView *header_view, + ModestGtkhtmlMsgView *self) +{ + g_signal_emit_by_name (G_OBJECT (self), "show-details"); +} + +static void on_attachment_activated (ModestAttachmentsView * att_view, TnyMimePart *mime_part, gpointer self) {