diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-08-28 22:58:25 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-08-28 22:58:25 +0800 |
commit | fd017fc993a6a71eb96ca67a63621cc1e21c138d (patch) | |
tree | d02841fc720238c662c71abeaa49c20871d225b4 /mail/mail-view.c | |
parent | 906a178ce8264e7848330d5244639c0c2d856aee (diff) | |
download | gsoc2013-evolution-fd017fc993a6a71eb96ca67a63621cc1e21c138d.tar gsoc2013-evolution-fd017fc993a6a71eb96ca67a63621cc1e21c138d.tar.gz gsoc2013-evolution-fd017fc993a6a71eb96ca67a63621cc1e21c138d.tar.bz2 gsoc2013-evolution-fd017fc993a6a71eb96ca67a63621cc1e21c138d.tar.lz gsoc2013-evolution-fd017fc993a6a71eb96ca67a63621cc1e21c138d.tar.xz gsoc2013-evolution-fd017fc993a6a71eb96ca67a63621cc1e21c138d.tar.zst gsoc2013-evolution-fd017fc993a6a71eb96ca67a63621cc1e21c138d.zip |
Display the number of messages downloaded starting from one instead of
zero.
Improve the behavior of the mail view in a separate window by reusing
the same size as the last resize (we could have a better policy, but
this should be enough for now). Also, create the toolbar the right
way so that we respect the global GNOME settings without doing it
manually.
svn path=/trunk/; revision=5075
Diffstat (limited to 'mail/mail-view.c')
-rw-r--r-- | mail/mail-view.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/mail/mail-view.c b/mail/mail-view.c index 065386f4ff..989d1a2a3a 100644 --- a/mail/mail-view.c +++ b/mail/mail-view.c @@ -32,6 +32,12 @@ typedef struct mail_view_data_s { MailDisplay *md; } mail_view_data; +#define MINIMUM_WIDTH 600 +#define MINIMUM_HEIGHT 400 + +/* Size of the window last time it was changed. */ +static GtkAllocation last_allocation = { 0, 0 }; + static void mail_view_data_free (gpointer mvd) { @@ -127,6 +133,13 @@ view_delete_msg (GtkWidget *button, gpointer user_data) CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED); } +static void +view_size_allocate_cb (GtkWidget *widget, + GtkAllocation *allocation) +{ + last_allocation = *allocation; +} + static GnomeUIInfo mail_view_toolbar [] = { /*GNOMEUIINFO_ITEM_STOCK (N_("Save"), N_("Save this message"), @@ -175,13 +188,23 @@ static GnomeUIInfo mail_view_menubar[] = GNOMEUIINFO_END }; +static void +set_default_size (GtkWidget *widget) +{ + int width, height; + + width = MAX (MINIMUM_WIDTH, last_allocation.width); + height = MAX (MINIMUM_HEIGHT, last_allocation.height); + + gtk_window_set_default_size (GTK_WINDOW (widget), width, height); +} + GtkWidget * mail_view_create (CamelFolder *source, const char *uid, CamelMimeMessage *msg) { GtkWidget *window; GtkWidget *toolbar; GtkWidget *mail_display; - GnomeDockItemBehavior behavior; char *subject; mail_view_data *data; @@ -199,16 +222,7 @@ mail_view_create (CamelFolder *source, const char *uid, CamelMimeMessage *msg) mail_view_toolbar, NULL, data); - behavior = GNOME_DOCK_ITEM_BEH_NORMAL; - if (!gnome_preferences_get_toolbar_detachable ()) - behavior |= GNOME_DOCK_ITEM_BEH_LOCKED; - - gnome_app_add_toolbar (GNOME_APP (window), - GTK_TOOLBAR (toolbar), - GNOME_APP_TOOLBAR_NAME, - behavior, - GNOME_DOCK_TOP, 1, 0, 0); - + gnome_app_set_toolbar (GNOME_APP (window), GTK_TOOLBAR (toolbar)); gnome_app_create_menus (GNOME_APP (window), mail_view_menubar); gtk_object_set_data_full (GTK_OBJECT (window), "mvd", data, @@ -234,11 +248,12 @@ mail_view_create (CamelFolder *source, const char *uid, CamelMimeMessage *msg) mail_display_set_message (MAIL_DISPLAY (mail_display), CAMEL_MEDIUM (msg)); data->md = MAIL_DISPLAY (mail_display); gnome_app_set_contents (GNOME_APP (window), mail_display); - - gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); + gtk_signal_connect (GTK_OBJECT (window), "size_allocate", + GTK_SIGNAL_FUNC (view_size_allocate_cb), NULL); + + set_default_size (window); + return window; } - - |