summaryrefslogtreecommitdiff
path: root/libxfce4ui/xfce-titled-dialog.c
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2011-05-29 17:44:11 +0200
committerNick Schermer <nick@xfce.org>2011-05-29 17:46:11 +0200
commit6e48a2717dea7dacedd3ce13185ebef22a95714b (patch)
tree6175b112543c81b22260144187a3ef9ff715716f /libxfce4ui/xfce-titled-dialog.c
parent70a055c7f942f50d35b2c8652944cb33c46683ad (diff)
downloadlibxfce4ui-6e48a2717dea7dacedd3ce13185ebef22a95714b.tar.gz
Cleanup the heading code.
With the assumption this widget will not be made public anymore, we can strip a bunch of code. Also attach the window signals later in the titled-dialog so they are not triggered before we're actually going to show the window.
Diffstat (limited to 'libxfce4ui/xfce-titled-dialog.c')
-rw-r--r--libxfce4ui/xfce-titled-dialog.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/libxfce4ui/xfce-titled-dialog.c b/libxfce4ui/xfce-titled-dialog.c
index 385afa1..bde9651 100644
--- a/libxfce4ui/xfce-titled-dialog.c
+++ b/libxfce4ui/xfce-titled-dialog.c
@@ -55,6 +55,7 @@ static void xfce_titled_dialog_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
+static void xfce_titled_dialog_realize (GtkWidget *widget);
static void xfce_titled_dialog_close (GtkDialog *dialog);
static void xfce_titled_dialog_update_heading (XfceTitledDialog *titled_dialog);
@@ -78,6 +79,7 @@ xfce_titled_dialog_class_init (XfceTitledDialogClass *klass)
GtkDialogClass *gtkdialog_class;
GtkBindingSet *binding_set;
GObjectClass *gobject_class;
+ GtkWidgetClass *gtkwidget_class;
/* add our private data to the class */
g_type_class_add_private (klass, sizeof (XfceTitledDialogPrivate));
@@ -87,6 +89,9 @@ xfce_titled_dialog_class_init (XfceTitledDialogClass *klass)
gobject_class->get_property = xfce_titled_dialog_get_property;
gobject_class->set_property = xfce_titled_dialog_set_property;
+ gtkwidget_class = GTK_WIDGET_CLASS (klass);
+ gtkwidget_class->realize = xfce_titled_dialog_realize;
+
gtkdialog_class = GTK_DIALOG_CLASS (klass);
gtkdialog_class->close = xfce_titled_dialog_close;
@@ -131,7 +136,7 @@ xfce_titled_dialog_init (XfceTitledDialog *titled_dialog)
gtk_widget_show (vbox);
/* add the heading to the window */
- titled_dialog->priv->heading = _xfce_heading_new ();
+ titled_dialog->priv->heading = g_object_new (XFCE_TYPE_HEADING, NULL);
gtk_box_pack_start (GTK_BOX (vbox), titled_dialog->priv->heading, FALSE, FALSE, 0);
gtk_widget_show (titled_dialog->priv->heading);
@@ -143,14 +148,6 @@ xfce_titled_dialog_init (XfceTitledDialog *titled_dialog)
/* add the main dialog box to the new vbox */
gtk_box_pack_start (GTK_BOX (vbox), GTK_DIALOG (titled_dialog)->vbox, TRUE, TRUE, 0);
g_object_unref (G_OBJECT (GTK_DIALOG (titled_dialog)->vbox));
-
- /* make sure to update the heading whenever one of the relevant window properties changes */
- g_signal_connect (G_OBJECT (titled_dialog), "notify::icon", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
- g_signal_connect (G_OBJECT (titled_dialog), "notify::icon-name", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
- g_signal_connect (G_OBJECT (titled_dialog), "notify::title", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
-
- /* initially update the heading properties */
- xfce_titled_dialog_update_heading (titled_dialog);
}
@@ -214,6 +211,24 @@ xfce_titled_dialog_set_property (GObject *object,
static void
+xfce_titled_dialog_realize (GtkWidget *widget)
+{
+ XfceTitledDialog *titled_dialog = XFCE_TITLED_DIALOG (widget);
+
+ /* make sure to update the heading whenever one of the relevant window properties changes */
+ g_signal_connect (G_OBJECT (titled_dialog), "notify::icon", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
+ g_signal_connect (G_OBJECT (titled_dialog), "notify::icon-name", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
+ g_signal_connect (G_OBJECT (titled_dialog), "notify::title", G_CALLBACK (xfce_titled_dialog_update_heading), NULL);
+
+ /* initially update the heading properties */
+ xfce_titled_dialog_update_heading (titled_dialog);
+
+ (*GTK_WIDGET_CLASS (xfce_titled_dialog_parent_class)->realize) (widget);
+}
+
+
+
+static void
xfce_titled_dialog_close (GtkDialog *dialog)
{
GdkEvent *event;