summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2008-05-19 17:25:19 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2008-05-19 17:25:19 +0000
commit20ee3a022e30f9c37205c941d50489c01a1a2ba9 (patch)
tree7b5ace751f409809a520360f5bd1104e3acf87e9 /gtk
parent02fd7ba04045bc4c8854c3fdd24e67b78a49b375 (diff)
downloadgtk+-20ee3a022e30f9c37205c941d50489c01a1a2ba9.tar.gz
bgo322298 - Make the file chooser dialog always resizable
2008-05-19 Federico Mena Quintero <federico@novell.com> http://bugzilla.gnome.org/show_bug.cgi?id=322298 - Save dialog can't be resized until you expand the "Browse for other folders" section. * gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface): Removed the "get_resizable" method. (_gtk_file_chooser_embed_get_resizable): Removed. * gtk/gtkfilechooserembed.c: Removed the _get_resizable() machinery. * gtk/gtkfilechooserdefault.c: Likewise. * gtk/gtkfilechooserdialog.c (file_chooser_widget_default_size_changed): Act as if the dialog were always resizable. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=20113
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfilechooserdefault.c22
-rw-r--r--gtk/gtkfilechooserdialog.c13
-rw-r--r--gtk/gtkfilechooserembed.c16
-rw-r--r--gtk/gtkfilechooserembed.h2
4 files changed, 1 insertions, 52 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 73e71424e0..bef9783b17 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -366,7 +366,6 @@ static GSList * gtk_file_chooser_default_list_shortcut_folders (GtkFileCh
static void gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
gint *default_width,
gint *default_height);
-static gboolean gtk_file_chooser_default_get_resizable (GtkFileChooserEmbed *chooser_embed);
static gboolean gtk_file_chooser_default_should_respond (GtkFileChooserEmbed *chooser_embed);
static void gtk_file_chooser_default_initial_focus (GtkFileChooserEmbed *chooser_embed);
@@ -811,7 +810,6 @@ static void
gtk_file_chooser_embed_default_iface_init (GtkFileChooserEmbedIface *iface)
{
iface->get_default_size = gtk_file_chooser_default_get_default_size;
- iface->get_resizable = gtk_file_chooser_default_get_resizable;
iface->should_respond = gtk_file_chooser_default_should_respond;
iface->initial_focus = gtk_file_chooser_default_initial_focus;
}
@@ -6032,14 +6030,6 @@ gtk_file_chooser_default_size_allocate (GtkWidget *widget,
GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->size_allocate (widget, allocation);
- if (!gtk_file_chooser_default_get_resizable (GTK_FILE_CHOOSER_EMBED (impl)))
- {
- /* The dialog is not resizable, we shouldn't
- * trust in the size it has in this stage
- */
- return;
- }
-
impl->default_width = allocation->width;
impl->default_height = allocation->height;
@@ -7946,18 +7936,6 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
}
}
-static gboolean
-gtk_file_chooser_default_get_resizable (GtkFileChooserEmbed *chooser_embed)
-{
- GtkFileChooserDefault *impl;
-
- impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
-
- return (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
- impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
- gtk_expander_get_expanded (GTK_EXPANDER (impl->save_expander)));
-}
-
struct switch_folder_closure {
GtkFileChooserDefault *impl;
const GtkFilePath *path;
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index 0a70233eec..7037cf5912 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -185,7 +185,6 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
gint width, height;
gint default_width, default_height;
GtkRequisition req, widget_req;
- gboolean resizable;
priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
@@ -208,7 +207,6 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
height = GTK_WIDGET (dialog)->allocation.height - widget->allocation.height;
}
- resizable = _gtk_file_chooser_embed_get_resizable (GTK_FILE_CHOOSER_EMBED (priv->widget));
_gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
&default_width, &default_height);
@@ -219,16 +217,7 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (dialog))
clamp_to_screen (GTK_WIDGET (dialog), &width, &height);
- if (resizable)
- {
- gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
- gtk_window_resize (GTK_WINDOW (dialog), width, height);
- }
- else
- {
- gtk_widget_set_size_request (GTK_WIDGET (dialog), width, -1);
- gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
- }
+ gtk_window_resize (GTK_WINDOW (dialog), width, height);
}
static void
diff --git a/gtk/gtkfilechooserembed.c b/gtk/gtkfilechooserembed.c
index 5816dcaf36..f85b1a2aaf 100644
--- a/gtk/gtkfilechooserembed.c
+++ b/gtk/gtkfilechooserembed.c
@@ -28,7 +28,6 @@ static void gtk_file_chooser_embed_class_init (gpointer g_iface);
static void delegate_get_default_size (GtkFileChooserEmbed *chooser_embed,
gint *default_width,
gint *default_height);
-static gboolean delegate_get_resizable (GtkFileChooserEmbed *chooser_embed);
static gboolean delegate_should_respond (GtkFileChooserEmbed *chooser_embed);
static void delegate_initial_focus (GtkFileChooserEmbed *chooser_embed);
static void delegate_default_size_changed (GtkFileChooserEmbed *chooser_embed,
@@ -55,7 +54,6 @@ void
_gtk_file_chooser_embed_delegate_iface_init (GtkFileChooserEmbedIface *iface)
{
iface->get_default_size = delegate_get_default_size;
- iface->get_resizable = delegate_get_resizable;
iface->should_respond = delegate_should_respond;
iface->initial_focus = delegate_initial_focus;
}
@@ -96,12 +94,6 @@ delegate_get_default_size (GtkFileChooserEmbed *chooser_embed,
}
static gboolean
-delegate_get_resizable (GtkFileChooserEmbed *chooser_embed)
-{
- return _gtk_file_chooser_embed_get_resizable (get_delegate (chooser_embed));
-}
-
-static gboolean
delegate_should_respond (GtkFileChooserEmbed *chooser_embed)
{
return _gtk_file_chooser_embed_should_respond (get_delegate (chooser_embed));
@@ -203,11 +195,3 @@ _gtk_file_chooser_embed_initial_focus (GtkFileChooserEmbed *chooser_embed)
GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->initial_focus (chooser_embed);
}
-
-gboolean
-_gtk_file_chooser_embed_get_resizable (GtkFileChooserEmbed *chooser_embed)
-{
- g_return_val_if_fail (GTK_IS_FILE_CHOOSER_EMBED (chooser_embed), FALSE);
-
- return GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->get_resizable (chooser_embed);
-}
diff --git a/gtk/gtkfilechooserembed.h b/gtk/gtkfilechooserembed.h
index 083bd45d71..65888981e2 100644
--- a/gtk/gtkfilechooserembed.h
+++ b/gtk/gtkfilechooserembed.h
@@ -43,7 +43,6 @@ struct _GtkFileChooserEmbedIface
void (*get_default_size) (GtkFileChooserEmbed *chooser_embed,
gint *default_width,
gint *default_height);
- gboolean (*get_resizable) (GtkFileChooserEmbed *chooser_embed);
gboolean (*should_respond) (GtkFileChooserEmbed *chooser_embed);
@@ -59,7 +58,6 @@ GType _gtk_file_chooser_embed_get_type (void) G_GNUC_CONST;
void _gtk_file_chooser_embed_get_default_size (GtkFileChooserEmbed *chooser_embed,
gint *default_width,
gint *default_height);
-gboolean _gtk_file_chooser_embed_get_resizable (GtkFileChooserEmbed *chooser_embed);
gboolean _gtk_file_chooser_embed_should_respond (GtkFileChooserEmbed *chooser_embed);
void _gtk_file_chooser_embed_initial_focus (GtkFileChooserEmbed *chooser_embed);