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
This commit is contained in:
Federico Mena Quintero 2008-05-19 17:25:19 +00:00 committed by Federico Mena Quintero
parent 02fd7ba040
commit 20ee3a022e
5 changed files with 19 additions and 52 deletions

View File

@ -1,3 +1,21 @@
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.
2008-05-19 Michael Natterer <mitch@imendio.com>
* gtk/gtkcellrenderer.c

View File

@ -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;

View File

@ -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

View File

@ -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;
}
@ -95,12 +93,6 @@ delegate_get_default_size (GtkFileChooserEmbed *chooser_embed,
_gtk_file_chooser_embed_get_default_size (get_delegate (chooser_embed), default_width, default_height);
}
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)
{
@ -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);
}

View File

@ -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);