From c5940bddfcf97db7d767727befa1e19cfb6c12df Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Wed, 17 Aug 2005 13:25:50 +0000 Subject: Fix a warning. (efhd_bar_resize): Fix the bar size to match other widgets. 2005-08-17 Srinivasa Ragavan * em-format-html-display.c (efhd_bar_save_selected): Fix a warning. (efhd_bar_resize): Fix the bar size to match other widgets. (efhd_bar_scroll_event): Fix scroll issue over bar. bug #312224. (efhd_add_bar): Add a frame around the attachment bar. bug #312033 svn path=/trunk/; revision=30147 --- mail/ChangeLog | 8 ++++++++ mail/em-format-html-display.c | 27 +++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 8f08687df1..88c11c9999 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2005-08-17 Srinivasa Ragavan + + * em-format-html-display.c + (efhd_bar_save_selected): Fix a warning. + (efhd_bar_resize): Fix the bar size to match other widgets. + (efhd_bar_scroll_event): Fix scroll issue over bar. bug #312224. + (efhd_add_bar): Add a frame around the attachment bar. bug #312033 + 2005-08-17 Kaushal Kumar * em-composer-prefs.c (url_requested): Add the close call for fd. diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index e0a309d90f..973f771ca0 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -1777,8 +1778,9 @@ efhd_bar_popup_position(GtkMenu *menu, int *x, int *y, gboolean *push_in, gpoint } static void -efhd_bar_save_selected(EPopup *ep, EPopupItem *item, EMFormatHTMLDisplay *efhd) +efhd_bar_save_selected(EPopup *ep, EPopupItem *item, void *data) { + EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)data; GSList *attachment_parts, *tmp; GSList *parts = NULL; @@ -1883,7 +1885,6 @@ efhd_attachment_bar_refresh (EMFormatHTMLDisplay *efhd) } } - static void efhd_bar_resize(GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh) { @@ -1892,13 +1893,26 @@ efhd_bar_resize(GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh) EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *) efh; gtk_widget_size_request (efhd->priv->attachment_bar, &req); - width = ((GtkWidget *) efh->html)->allocation.width - 36; + width = ((GtkWidget *) efh->html)->allocation.width - 16; gtk_widget_set_size_request (efhd->priv->attachment_bar, width, req.height); /* Update the bar to refresh the icons and adjust the height */ e_attachment_bar_refresh (E_ATTACHMENT_BAR(efhd->priv->attachment_bar)); } +static gboolean +efhd_bar_scroll_event(GtkWidget *w, GdkEventScroll *event, EMFormatHTMLDisplay *efhd) +{ + gboolean ret; + + /* Emulate the scroll over the attachment bar, as if it is scrolled in the window. + * It doesnt go automatically since the GnomeIconList is a layout by itself + */ + g_signal_emit_by_name (gtk_widget_get_parent((GtkWidget *)efhd->formathtml.html), "scroll_event", event, &ret); + + return TRUE; +} + static gboolean efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) { @@ -1932,15 +1946,15 @@ efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobjec gtk_box_pack_start ((GtkBox *)hbox2, priv->label, FALSE, FALSE, 2); gtk_box_pack_start ((GtkBox *)hbox2, save, FALSE, FALSE, 2); - priv->attachment_box = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start ((GtkBox *)priv->attachment_box, priv->attachment_bar, TRUE, TRUE, 0); + priv->attachment_box = gtk_frame_new (NULL); + gtk_container_add ((GtkContainer *)priv->attachment_box, priv->attachment_bar); gtk_widget_get_size_request(priv->attachment_bar, &width, &height); /* FIXME: What if the text is more?. Should we reduce the text with appending ...? * or resize the bar? How to figure out that, it needs more space? */ gtk_widget_set_size_request (priv->attachment_bar, - ((GtkWidget *)efh->html)->parent->allocation.width - /* FIXME */36, + ((GtkWidget *)efh->html)->parent->allocation.width - /* FIXME */16, 84 /* FIXME: Default show only one row, Dont hardcode size*/); vbox = gtk_vbox_new (FALSE, 0); @@ -1959,6 +1973,7 @@ efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobjec g_signal_connect (priv->attachment_bar, "popup-menu", G_CALLBACK(efhd_bar_popup_menu_event), efhd); g_signal_connect (save, "clicked", G_CALLBACK(attachments_save_all_clicked), efh); g_signal_connect (eb, "size_allocate", G_CALLBACK (efhd_bar_resize), efh); + g_signal_connect (priv->attachment_bar, "scroll_event", G_CALLBACK(efhd_bar_scroll_event), efhd); return TRUE; } -- cgit v1.2.3