summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdialog.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@gnome.org>2004-02-29 07:55:24 +0000
committerJonathan Blandford <jrb@src.gnome.org>2004-02-29 07:55:24 +0000
commit7359903ef071841f629b2e3fca6f6d458e20fa58 (patch)
tree141a7edc012e3c205bd98cad40d9095c204c69ec /gtk/gtkfilechooserdialog.c
parentbe1e6e6bea315af7345818fcb143c5c8e98e499d (diff)
downloadgtk+-7359903ef071841f629b2e3fca6f6d458e20fa58.tar.gz
Add g_return_if_fail() (_gtk_file_chooser_embed_get_resizable_hints): Add
Sun Feb 29 01:51:27 2004 Jonathan Blandford <jrb@gnome.org> * gtk/gtkfilechooserembed.c (_gtk_file_chooser_embed_get_default_size): Add g_return_if_fail() (_gtk_file_chooser_embed_get_resizable_hints): Add g_return_if_fail() * gtk/gtkfilechooserdialog.c (file_chooser_widget_default_size_changed): Get the correct initial size for the dialog. Also, don't bother with gtk_window_set_default_size(). It's not really meaningful. * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_get_default_size): Get the correct spacing for the preview_widget (update_preview_widget_visibility): Clear widget field after we destroy it.
Diffstat (limited to 'gtk/gtkfilechooserdialog.c')
-rw-r--r--gtk/gtkfilechooserdialog.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index 6239f1f21d..e9cb26ea41 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -27,9 +27,6 @@
#include <stdarg.h>
-#define NUM_LINES 40
-#define NUM_CHARS 50
-
struct _GtkFileChooserDialogPrivate
{
GtkWidget *widget;
@@ -59,8 +56,8 @@ static void gtk_file_chooser_dialog_get_property (GObject *obj
GValue *value,
GParamSpec *pspec);
-static void gtk_file_chooser_dialog_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
+static void gtk_file_chooser_dialog_style_set (GtkWidget *widget,
+ GtkStyle *previous_style);
static GObjectClass *parent_class;
@@ -160,9 +157,14 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
gint extra_width;
gint extra_height;
gint width, height;
+ GtkRequisition req;
priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
+ /* Force a size request of everything before we start. This will make sure
+ * that widget->requisition is meaningful. */
+ gtk_widget_size_request (GTK_WIDGET (dialog), &req);
+
/* Determine how much space the rest of the dialog uses compared to priv->widget */
extra_width = GTK_WIDGET (dialog)->requisition.width - priv->widget->requisition.width;
extra_height = GTK_WIDGET (dialog)->requisition.height - priv->widget->requisition.height;
@@ -173,7 +175,6 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
width = extra_width + width;
height = extra_height + height;
- /* g_print ("file_chooser_widget_default_size_changed: %d %d\n", width, height);*/
/* FIXME: We should make sure that we arent' bigger than the current screen */
if (GTK_WIDGET_REALIZED (dialog) &&
priv->default_width > 0 &&
@@ -183,6 +184,7 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
gint dx, dy;
gtk_window_get_size (GTK_WINDOW (dialog), &cur_width, &cur_height);
+
dx = width - priv->default_width;
dy = height - priv->default_height;
gtk_window_resize (GTK_WINDOW (dialog),
@@ -191,7 +193,7 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
}
else
{
- gtk_window_set_default_size (GTK_WINDOW (dialog), width, height);
+ gtk_window_resize (GTK_WINDOW (dialog), width, height);
}
priv->default_width = width;
priv->default_height = height;
@@ -268,6 +270,7 @@ gtk_file_chooser_dialog_get_property (GObject *object,
g_object_get_property (G_OBJECT (priv->widget), pspec->name, value);
}
+#if 0
static void
set_default_size (GtkFileChooserDialog *dialog)
{
@@ -316,6 +319,7 @@ set_default_size (GtkFileChooserDialog *dialog)
(default_width == -1) ? width : default_width,
(default_height == -1) ? height : default_height);
}
+#endif
static void
gtk_file_chooser_dialog_style_set (GtkWidget *widget,