From a11c1bd6f32f63f0539fa70da41e4c62211714f4 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Mon, 1 Mar 2004 21:52:04 +0000 Subject: [PATCH] only store the size if we can resize in that direction. Mon Mar 1 16:51:21 2004 Jonathan Blandford * gtk/gtkfilechooserdialog.c (file_chooser_widget_default_size_changed): only store the size if we can resize in that direction. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkfilechooserdefault.c | 7 +++++-- gtk/gtkfilechooserdialog.c | 13 +++++++++++-- 7 files changed, 46 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a4baf9385..f69483c38f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Mar 1 16:51:21 2004 Jonathan Blandford + + * gtk/gtkfilechooserdialog.c + (file_chooser_widget_default_size_changed): only store the size if + we can resize in that direction. + Mon Mar 1 16:32:52 2004 Jonathan Blandford * gtk/gtkfilechooserwidget.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4a4baf9385..f69483c38f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Mon Mar 1 16:51:21 2004 Jonathan Blandford + + * gtk/gtkfilechooserdialog.c + (file_chooser_widget_default_size_changed): only store the size if + we can resize in that direction. + Mon Mar 1 16:32:52 2004 Jonathan Blandford * gtk/gtkfilechooserwidget.c diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 4a4baf9385..f69483c38f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Mon Mar 1 16:51:21 2004 Jonathan Blandford + + * gtk/gtkfilechooserdialog.c + (file_chooser_widget_default_size_changed): only store the size if + we can resize in that direction. + Mon Mar 1 16:32:52 2004 Jonathan Blandford * gtk/gtkfilechooserwidget.c diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4a4baf9385..f69483c38f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Mon Mar 1 16:51:21 2004 Jonathan Blandford + + * gtk/gtkfilechooserdialog.c + (file_chooser_widget_default_size_changed): only store the size if + we can resize in that direction. + Mon Mar 1 16:32:52 2004 Jonathan Blandford * gtk/gtkfilechooserwidget.c diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4a4baf9385..f69483c38f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Mon Mar 1 16:51:21 2004 Jonathan Blandford + + * gtk/gtkfilechooserdialog.c + (file_chooser_widget_default_size_changed): only store the size if + we can resize in that direction. + Mon Mar 1 16:32:52 2004 Jonathan Blandford * gtk/gtkfilechooserwidget.c diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index c56a01060e..41f7dc6865 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1886,7 +1886,7 @@ save_widgets_create (GtkFileChooserDefault *impl) gtk_widget_show (widget); impl->save_file_name_entry = gtk_entry_new (); - gtk_entry_set_width_chars (GTK_ENTRY (impl->save_file_name_entry), 25); + gtk_entry_set_width_chars (GTK_ENTRY (impl->save_file_name_entry), 45); gtk_entry_set_activates_default (GTK_ENTRY (impl->save_file_name_entry), TRUE); gtk_table_attach (GTK_TABLE (table), impl->save_file_name_entry, 1, 2, 0, 1, @@ -3193,7 +3193,10 @@ gtk_file_chooser_default_get_resizable_hints (GtkFileChooserEmbed *chooser_embed impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) { if (! gtk_expander_get_expanded (GTK_EXPANDER (impl->save_expander))) - *resize_vertically = FALSE; + { + *resize_vertically = FALSE; + *resize_horizontally = FALSE; + } } } } diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c index db4dff6676..d40664eb4c 100644 --- a/gtk/gtkfilechooserdialog.c +++ b/gtk/gtkfilechooserdialog.c @@ -184,6 +184,8 @@ file_chooser_widget_default_size_changed (GtkWidget *widget, gint extra_height; gint width, height; GtkRequisition req; + gboolean resize_horizontally; + gboolean resize_vertically; priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog); @@ -221,8 +223,15 @@ file_chooser_widget_default_size_changed (GtkWidget *widget, { gtk_window_resize (GTK_WINDOW (dialog), width, height); } - priv->default_width = width; - priv->default_height = height; + + _gtk_file_chooser_embed_get_resizable_hints (GTK_FILE_CHOOSER_EMBED (priv->widget), + &resize_horizontally, + &resize_vertically); + /* Only store the size if we can resize in that direction. */ + if (resize_horizontally) + priv->default_width = width; + if (resize_vertically) + priv->default_height = height; }