summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdefault.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/gtkfilechooserdefault.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/gtkfilechooserdefault.c')
-rw-r--r--gtk/gtkfilechooserdefault.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 9ac5a9a3b2..8e6c1e3505 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -72,7 +72,6 @@ typedef struct _GtkFileChooserDefaultClass GtkFileChooserDefaultClass;
#define GTK_IS_FILE_CHOOSER_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_CHOOSER_DEFAULT))
#define GTK_FILE_CHOOSER_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FILE_CHOOSER_DEFAULT, GtkFileChooserDefaultClass))
-#define PREVIEW_HBOX_SPACING 12
struct _GtkFileChooserDefaultClass
{
@@ -207,6 +206,9 @@ typedef enum {
/* Standard icon size */
/* FIXME: maybe this should correspond to the font size in the tree views... */
#define ICON_SIZE 20
+#define PREVIEW_HBOX_SPACING 12
+#define NUM_LINES 40
+#define NUM_CHARS 60
static void gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class);
static void gtk_file_chooser_default_iface_init (GtkFileChooserIface *iface);
@@ -639,7 +641,10 @@ update_preview_widget_visibility (GtkFileChooserDefault *impl)
else
{
if (impl->preview_label)
- gtk_widget_destroy (impl->preview_label);
+ {
+ gtk_widget_destroy (impl->preview_label);
+ impl->preview_label = NULL;
+ }
}
if (impl->preview_widget_active && impl->preview_widget)
@@ -2186,6 +2191,7 @@ update_appearance (GtkFileChooserDefault *impl)
gtk_widget_hide (impl->save_extra_align);
gtk_widget_hide (impl->browse_extra_align);
}
+
g_signal_emit_by_name (impl, "default-size-changed");
}
@@ -2342,7 +2348,7 @@ static void
gtk_file_chooser_default_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
- if (GTK_WIDGET_CLASS (parent_class)->style_set)
+ if (GTK_WIDGET_CLASS (parent_class)->style_set)
GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
g_signal_emit_by_name (widget, "default-size-changed");
@@ -3094,9 +3100,6 @@ gtk_file_chooser_default_list_shortcut_folders (GtkFileChooser *chooser)
return g_slist_reverse (list);
}
-#define NUM_LINES 40
-#define NUM_CHARS 50
-
/* Guesses a size based upon font sizes */
static void
find_good_size_from_style (GtkWidget *widget,
@@ -3145,7 +3148,7 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
if (impl->preview_widget_active && impl->preview_widget)
- *default_width += impl->preview_widget->requisition.width + PREVIEW_HBOX_SPACING;
+ *default_width += impl->preview_box->requisition.width + PREVIEW_HBOX_SPACING;
}
static void