diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-03-14 08:13:01 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-03-14 08:13:01 +0800 |
commit | 828991183bc924b2ec7d5019790e9200d9a37a6d (patch) | |
tree | c7e1c17bfd46051501a252c0ed9957049e5bbd0a /mail | |
parent | 1d0160ac11ca74d21207f4c51fe57028d3c12dee (diff) | |
download | gsoc2013-evolution-828991183bc924b2ec7d5019790e9200d9a37a6d.tar.gz gsoc2013-evolution-828991183bc924b2ec7d5019790e9200d9a37a6d.tar.zst gsoc2013-evolution-828991183bc924b2ec7d5019790e9200d9a37a6d.zip |
Set a default size of the window, so we don't get this itty-bitty window
2002-03-13 Jeffrey Stedfast <fejj@ximian.com>
* 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
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/folder-browser-window.c | 28 |
2 files changed, 34 insertions, 0 deletions
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 <fejj@ximian.com> + + * 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 <fejj@ximian.com> * 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); } |