aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2005-08-17 21:25:50 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2005-08-17 21:25:50 +0800
commitc5940bddfcf97db7d767727befa1e19cfb6c12df (patch)
tree39e2684fc3035f625a022cb5961ea6c3f01dfe81
parentdedae38804fb2f619e4e8b3d640848c9cc8ad291 (diff)
downloadgsoc2013-evolution-c5940bddfcf97db7d767727befa1e19cfb6c12df.tar.gz
gsoc2013-evolution-c5940bddfcf97db7d767727befa1e19cfb6c12df.tar.zst
gsoc2013-evolution-c5940bddfcf97db7d767727befa1e19cfb6c12df.zip
Fix a warning. (efhd_bar_resize): Fix the bar size to match other widgets.
2005-08-17 Srinivasa Ragavan <sragavan@novell.com> * 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
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/em-format-html-display.c27
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 <sragavan@novell.com>
+
+ * 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 <kakumar@novell.com>
* 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 <gtk/gtkmain.h>
#include <gtk/gtkdnd.h>
#include <gtk/gtktoolbutton.h>
+#include <gtk/gtkframe.h>
#include <glade/glade.h>
@@ -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,7 +1893,7 @@ 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 */
@@ -1900,6 +1901,19 @@ efhd_bar_resize(GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh)
}
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)
{
EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)efh;
@@ -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;
}