[PATCH 6/7] bgo543308 - Only compute a font-based size if we are in expanded mode or one of the OPEN modes

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=21167
This commit is contained in:
Federico Mena Quintero 2008-08-20 01:12:54 +00:00 committed by Federico Mena Quintero
parent 8a8915e0fd
commit 967a68008f

View File

@ -7806,21 +7806,33 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
GtkRequisition req;
impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
if (impl->preview_widget_active &&
impl->preview_widget &&
GTK_WIDGET_VISIBLE (impl->preview_widget))
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
|| impl->expand_folders)
{
gtk_widget_size_request (impl->preview_box, &req);
*default_width += PREVIEW_HBOX_SPACING + req.width;
find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
if (impl->preview_widget_active &&
impl->preview_widget &&
GTK_WIDGET_VISIBLE (impl->preview_widget))
{
gtk_widget_size_request (impl->preview_box, &req);
*default_width += PREVIEW_HBOX_SPACING + req.width;
}
if (impl->extra_widget &&
GTK_WIDGET_VISIBLE (impl->extra_widget))
{
gtk_widget_size_request (impl->extra_align, &req);
*default_height += GTK_BOX (chooser_embed)->spacing + req.height;
}
}
if (impl->extra_widget &&
GTK_WIDGET_VISIBLE (impl->extra_widget))
else
{
gtk_widget_size_request (impl->extra_align, &req);
*default_height += GTK_BOX (chooser_embed)->spacing + req.height;
gtk_widget_size_request (GTK_WIDGET (impl), &req);
*default_width = req.width;
*default_height = req.height;
}
}