diff options
author | Federico Mena Quintero <federico@ximian.com> | 2004-02-03 19:46:43 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2004-02-03 19:46:43 +0000 |
commit | d08dd112ccda04400cdb19360903971525c24706 (patch) | |
tree | 121e980c836f7c706343d8a7904a09804a801159 /gtk/gtkdialog.c | |
parent | 35efc9ba05a4f75936b434c4db934aaaa327be6d (diff) | |
download | gdk-pixbuf-d08dd112ccda04400cdb19360903971525c24706.tar.gz |
Fix #68938.
2004-02-03 Federico Mena Quintero <federico@ximian.com>
Fix #68938.
* gtk/gtkdialog.c (GtkDialogPrivate): New private structure for
GtkDialog; right now it only contains an ignore_separator field.
(gtk_dialog_class_init): Register the private structure.
(gtk_dialog_init): Initialize the priv->ignore_separator field.
(_gtk_dialog_set_ignore_separator): New private function.
(gtk_dialog_set_has_separator): Ignore the setting if appropriate.
* gtk/gtkmessagedialog.c (gtk_message_dialog_class_init): Add a
use_separator style property.
(gtk_message_dialog_style_set): Change the dialog's separator
based on the style property.
(gtk_message_dialog_init): Set the dialog box to ignore the
separator setting.
Diffstat (limited to 'gtk/gtkdialog.c')
-rw-r--r-- | gtk/gtkdialog.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 4785cf361..5b05b9d80 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -35,6 +35,12 @@ #include "gtkintl.h" #include "gtkbindings.h" +#define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_DIALOG, GtkDialogPrivate)) + +typedef struct { + guint ignore_separator : 1; +} GtkDialogPrivate; + typedef struct _ResponseData ResponseData; struct _ResponseData @@ -130,6 +136,8 @@ gtk_dialog_class_init (GtkDialogClass *class) class->close = gtk_dialog_close; + g_type_class_add_private (gobject_class, sizeof (GtkDialogPrivate)); + g_object_class_install_property (gobject_class, PROP_HAS_SEPARATOR, g_param_spec_boolean ("has_separator", @@ -219,6 +227,11 @@ update_spacings (GtkDialog *dialog) static void gtk_dialog_init (GtkDialog *dialog) { + GtkDialogPrivate *priv; + + priv = GET_PRIVATE (dialog); + priv->ignore_separator = FALSE; + /* To avoid breaking old code that prevents destroy on delete event * by connecting a handler, we have to have the FIRST signal * connection on the dialog. @@ -766,10 +779,20 @@ void gtk_dialog_set_has_separator (GtkDialog *dialog, gboolean setting) { + GtkDialogPrivate *priv; + g_return_if_fail (GTK_IS_DIALOG (dialog)); + priv = GET_PRIVATE (dialog); + /* this might fail if we get called before _init() somehow */ g_assert (dialog->vbox != NULL); + + if (priv->ignore_separator) + { + g_warning ("Ignoring the separator setting"); + return; + } if (setting && dialog->separator == NULL) { @@ -1001,3 +1024,13 @@ gtk_dialog_run (GtkDialog *dialog) return ri.response_id; } + +void +_gtk_dialog_set_ignore_separator (GtkDialog *dialog, + gboolean ignore_separator) +{ + GtkDialogPrivate *priv; + + priv = GET_PRIVATE (dialog); + priv->ignore_separator = ignore_separator; +} |