From 828991183bc924b2ec7d5019790e9200d9a37a6d Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 14 Mar 2002 00:13:01 +0000 Subject: Set a default size of the window, so we don't get this itty-bitty window 2002-03-13 Jeffrey Stedfast * folder-browser-window.c (folder_browser_window_new): Set a default size of the window, so we don't get this itty-bitty window the size of a quarter on the screen when it first gets shown. svn path=/trunk/; revision=16153 --- mail/ChangeLog | 6 ++++++ mail/folder-browser-window.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/mail/ChangeLog b/mail/ChangeLog index 1382e4a04f..df6925db21 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2002-03-13 Jeffrey Stedfast + + * folder-browser-window.c (folder_browser_window_new): Set a + default size of the window, so we don't get this itty-bitty window + the size of a quarter on the screen when it first gets shown. + 2002-03-12 Jeffrey Stedfast * mail-display.c (on_link_clicked): Handle digest: urls. diff --git a/mail/folder-browser-window.c b/mail/folder-browser-window.c index 3de5e5a042..11334fb590 100644 --- a/mail/folder-browser-window.c +++ b/mail/folder-browser-window.c @@ -36,10 +36,16 @@ #include "folder-browser-ui.h" + +#define MINIMUM_WIDTH 600 +#define MINIMUM_HEIGHT 400 + #define PARENT_TYPE (bonobo_window_get_type ()) static BonoboWindowClass *folder_browser_window_parent_class = NULL; +static GtkAllocation last_allocation = { 0, 0 }; + static void folder_browser_window_destroy (GtkObject *object) { @@ -71,6 +77,23 @@ folder_browser_window_init (GtkObject *object) } +static void +folder_browser_window_size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation) +{ + last_allocation = *allocation; +} + +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 * folder_browser_window_new (FolderBrowser *fb) { @@ -86,6 +109,8 @@ folder_browser_window_new (FolderBrowser *fb) if (!new) return NULL; + set_default_size (GTK_WIDGET (new)); + new->folder_browser = fb; bonobo_window_set_contents (BONOBO_WINDOW (new), GTK_WIDGET (fb)); @@ -101,6 +126,9 @@ folder_browser_window_new (FolderBrowser *fb) folder_browser_ui_add_message (fb); /*folder_browser_set_shell_view (fb, fb_get_svi (control));*/ + gtk_signal_connect (GTK_OBJECT (new), "size_allocate", + GTK_SIGNAL_FUNC (folder_browser_window_size_allocate_cb), NULL); + return GTK_WIDGET (new); } -- cgit v1.2.3