summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdialog.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-12-25 12:21:16 +0000
committerChristian Persch <chpe@src.gnome.org>2006-12-25 12:21:16 +0000
commitbcab1eb30be86f437f411c80569784e18a0e86ed (patch)
treee2c5f73c2818bd26bb605a0db46b09657cd49ce3 /gtk/gtkfilechooserdialog.c
parenta20da20873a271d7c9ea56ad1ca1402589875b4f (diff)
downloadgtk+-bcab1eb30be86f437f411c80569784e18a0e86ed.tar.gz
Set the HIG spacings directly instead of using style-set handlers. Fix the
2006-12-25 Christian Persch <chpe@cvs.gnome.org> * gtk/gtkaboutdialog.c: (gtk_about_dialog_class_init), (gtk_about_dialog_init), (display_credits_dialog), (display_license_dialog): * gtk/gtkfilechooserdialog.c: (gtk_file_chooser_dialog_class_init), (gtk_file_chooser_dialog_init), (gtk_file_chooser_dialog_constructor), (gtk_file_chooser_dialog_unmap): * gtk/gtkrecentchooserdefault.c: (_gtk_recent_chooser_default_init): * gtk/gtkrecentchooserdialog.c: (gtk_recent_chooser_dialog_class_init), (gtk_recent_chooser_dialog_init), (gtk_recent_chooser_dialog_constructor), (gtk_recent_chooser_dialog_unmap): Set the HIG spacings directly instead of using style-set handlers. Fix the filechooser's spacing between content and action area to 12px. Bug #372447.
Diffstat (limited to 'gtk/gtkfilechooserdialog.c')
-rw-r--r--gtk/gtkfilechooserdialog.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index 0c57e66a99..331f6819f5 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -49,8 +49,6 @@ static void gtk_file_chooser_dialog_get_property (GObject *obj
static void gtk_file_chooser_dialog_map (GtkWidget *widget);
static void gtk_file_chooser_dialog_unmap (GtkWidget *widget);
-static void gtk_file_chooser_dialog_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
static void response_cb (GtkDialog *dialog,
gint response_id);
@@ -72,7 +70,6 @@ gtk_file_chooser_dialog_class_init (GtkFileChooserDialogClass *class)
widget_class->map = gtk_file_chooser_dialog_map;
widget_class->unmap = gtk_file_chooser_dialog_unmap;
- widget_class->style_set = gtk_file_chooser_dialog_style_set;
_gtk_file_chooser_install_properties (gobject_class);
@@ -85,6 +82,8 @@ gtk_file_chooser_dialog_init (GtkFileChooserDialog *dialog)
GtkFileChooserDialogPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
GTK_TYPE_FILE_CHOOSER_DIALOG,
GtkFileChooserDialogPrivate);
+ GtkDialog *fc_dialog = GTK_DIALOG (dialog);
+
dialog->priv = priv;
dialog->priv->default_width = -1;
dialog->priv->default_height = -1;
@@ -92,7 +91,10 @@ gtk_file_chooser_dialog_init (GtkFileChooserDialog *dialog)
dialog->priv->resize_vertically = TRUE;
dialog->priv->response_requested = FALSE;
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+ gtk_dialog_set_has_separator (fc_dialog, FALSE);
+ gtk_container_set_border_width (GTK_CONTAINER (fc_dialog), 5);
+ gtk_box_set_spacing (GTK_BOX (fc_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (fc_dialog->action_area), 5);
/* We do a signal connection here rather than overriding the method in
* class_init because GtkDialog::response is a RUN_LAST signal. We want *our*
@@ -380,6 +382,7 @@ gtk_file_chooser_dialog_constructor (GType type,
g_signal_connect (priv->widget, "response-requested",
G_CALLBACK (file_chooser_widget_response_requested), object);
+ gtk_container_set_border_width (GTK_CONTAINER (priv->widget), 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox), priv->widget, TRUE, TRUE, 0);
gtk_widget_show (priv->widget);
@@ -508,29 +511,6 @@ gtk_file_chooser_dialog_unmap (GtkWidget *widget)
gtk_widget_unmap (priv->widget);
}
-static void
-gtk_file_chooser_dialog_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- GtkDialog *dialog;
-
- if (GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->style_set)
- GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->style_set (widget, previous_style);
-
- dialog = GTK_DIALOG (widget);
-
- /* Override the style properties with HIG-compliant spacings. Ugh.
- * http://developer.gnome.org/projects/gup/hig/1.0/layout.html#layout-dialogs
- * http://developer.gnome.org/projects/gup/hig/1.0/windows.html#alert-spacing
- */
-
- gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), 12);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 24);
-
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 0);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
-}
-
/* GtkDialog::response handler */
static void
response_cb (GtkDialog *dialog,