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.
This commit is contained in:
committed by
Federico Mena Quintero
parent
35efc9ba05
commit
d08dd112cc
18
ChangeLog
18
ChangeLog
@ -1,3 +1,21 @@
|
||||
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.
|
||||
|
||||
Tue Feb 3 02:35:09 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/Makefile.am: Build filesystemwin32.c if OS_WIN32 and
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
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.
|
||||
|
||||
Tue Feb 3 02:35:09 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/Makefile.am: Build filesystemwin32.c if OS_WIN32 and
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
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.
|
||||
|
||||
Tue Feb 3 02:35:09 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/Makefile.am: Build filesystemwin32.c if OS_WIN32 and
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
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.
|
||||
|
||||
Tue Feb 3 02:35:09 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/Makefile.am: Build filesystemwin32.c if OS_WIN32 and
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
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.
|
||||
|
||||
Tue Feb 3 02:35:09 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/Makefile.am: Build filesystemwin32.c if OS_WIN32 and
|
||||
|
||||
@ -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,11 +779,21 @@ 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)
|
||||
{
|
||||
dialog->separator = gtk_hseparator_new ();
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -159,6 +159,11 @@ void gtk_dialog_response (GtkDialog *dialog,
|
||||
/* Returns response_id */
|
||||
gint gtk_dialog_run (GtkDialog *dialog);
|
||||
|
||||
|
||||
/* For private use only */
|
||||
void _gtk_dialog_set_ignore_separator (GtkDialog *dialog,
|
||||
gboolean ignore_separator);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@ -109,6 +109,12 @@ gtk_message_dialog_class_init (GtkMessageDialogClass *class)
|
||||
G_MAXINT,
|
||||
8,
|
||||
G_PARAM_READABLE));
|
||||
gtk_widget_class_install_style_property (widget_class,
|
||||
g_param_spec_boolean ("use_separator",
|
||||
P_("Use separator"),
|
||||
P_("Whether to put a separator between the message dialog's text and the buttons"),
|
||||
FALSE,
|
||||
G_PARAM_READABLE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_MESSAGE_TYPE,
|
||||
g_param_spec_enum ("message_type",
|
||||
@ -153,6 +159,8 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (hbox);
|
||||
|
||||
_gtk_dialog_set_ignore_separator (GTK_DIALOG (dialog), TRUE);
|
||||
}
|
||||
|
||||
static GtkMessageType
|
||||
@ -499,6 +507,7 @@ gtk_message_dialog_style_set (GtkWidget *widget,
|
||||
{
|
||||
GtkWidget *parent;
|
||||
gint border_width = 0;
|
||||
gboolean use_separator;
|
||||
|
||||
parent = GTK_WIDGET (GTK_MESSAGE_DIALOG (widget)->image->parent);
|
||||
|
||||
@ -511,6 +520,13 @@ gtk_message_dialog_style_set (GtkWidget *widget,
|
||||
border_width);
|
||||
}
|
||||
|
||||
gtk_widget_style_get (widget,
|
||||
"use_separator", &use_separator,
|
||||
NULL);
|
||||
_gtk_dialog_set_ignore_separator (GTK_DIALOG (widget), FALSE);
|
||||
gtk_dialog_set_has_separator (GTK_DIALOG (widget), use_separator);
|
||||
_gtk_dialog_set_ignore_separator (GTK_DIALOG (widget), TRUE);
|
||||
|
||||
if (GTK_WIDGET_CLASS (parent_class)->style_set)
|
||||
(GTK_WIDGET_CLASS (parent_class)->style_set) (widget, prev_style);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user