From ecb4df1307fd5fc6c3d40267f676a74c6d242677 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 20 Feb 2004 18:02:21 +0000 Subject: [PATCH] impl. (gtk_tool_item_class_init): hook it up. 2004-02-20 Michael Meeks * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl. (gtk_tool_item_class_init): hook it up. (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity. * gtk/gtktoolbutton.c (gtk_tool_button_property_notify): chain to parent, fix strcmp bug. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ gtk/gtktoolbutton.c | 5 ++++- gtk/gtktoolitem.c | 17 +++++++++++++++++ 7 files changed, 56 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a24ef33e49..8d0ba2a97d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-02-20 Michael Meeks + * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl. + (gtk_tool_item_class_init): hook it up. + (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity. + + * gtk/gtktoolbutton.c (gtk_tool_button_property_notify): + chain to parent, fix strcmp bug. + * tests/testtoolbar.c (main): re-arrange widgets to allow more overflowing toolbar goodness. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a24ef33e49..8d0ba2a97d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,12 @@ 2004-02-20 Michael Meeks + * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl. + (gtk_tool_item_class_init): hook it up. + (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity. + + * gtk/gtktoolbutton.c (gtk_tool_button_property_notify): + chain to parent, fix strcmp bug. + * tests/testtoolbar.c (main): re-arrange widgets to allow more overflowing toolbar goodness. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index a24ef33e49..8d0ba2a97d 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,5 +1,12 @@ 2004-02-20 Michael Meeks + * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl. + (gtk_tool_item_class_init): hook it up. + (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity. + + * gtk/gtktoolbutton.c (gtk_tool_button_property_notify): + chain to parent, fix strcmp bug. + * tests/testtoolbar.c (main): re-arrange widgets to allow more overflowing toolbar goodness. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index a24ef33e49..8d0ba2a97d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,12 @@ 2004-02-20 Michael Meeks + * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl. + (gtk_tool_item_class_init): hook it up. + (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity. + + * gtk/gtktoolbutton.c (gtk_tool_button_property_notify): + chain to parent, fix strcmp bug. + * tests/testtoolbar.c (main): re-arrange widgets to allow more overflowing toolbar goodness. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index a24ef33e49..8d0ba2a97d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,12 @@ 2004-02-20 Michael Meeks + * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl. + (gtk_tool_item_class_init): hook it up. + (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity. + + * gtk/gtktoolbutton.c (gtk_tool_button_property_notify): + chain to parent, fix strcmp bug. + * tests/testtoolbar.c (main): re-arrange widgets to allow more overflowing toolbar goodness. diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 516f93c3b7..0796c89f1b 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -442,8 +442,11 @@ static void gtk_tool_button_property_notify (GObject *object, GParamSpec *pspec) { - if (strcmp (pspec->name, "is_important")) + if (strcmp (pspec->name, "is-important") == 0) gtk_tool_button_construct_contents (GTK_TOOL_ITEM (object)); + + if (parent_class->notify) + parent_class->notify (object, pspec); } static void diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c index 8969adf7eb..42c79cccf4 100644 --- a/gtk/gtktoolitem.c +++ b/gtk/gtktoolitem.c @@ -76,6 +76,8 @@ static void gtk_tool_item_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gtk_tool_item_property_notify (GObject *object, + GParamSpec *pspec); static void gtk_tool_item_realize (GtkWidget *widget); static void gtk_tool_item_unrealize (GtkWidget *widget); static void gtk_tool_item_map (GtkWidget *widget); @@ -136,6 +138,7 @@ gtk_tool_item_class_init (GtkToolItemClass *klass) object_class->set_property = gtk_tool_item_set_property; object_class->get_property = gtk_tool_item_get_property; object_class->finalize = gtk_tool_item_finalize; + object_class->notify = gtk_tool_item_property_notify; widget_class->realize = gtk_tool_item_realize; widget_class->unrealize = gtk_tool_item_unrealize; @@ -337,6 +340,17 @@ gtk_tool_item_get_property (GObject *object, } } +static void +gtk_tool_item_property_notify (GObject *object, + GParamSpec *pspec) +{ + GtkToolItem *tool_item = GTK_TOOL_ITEM (object); + + if (tool_item->priv->menu_item && strcmp (pspec->name, "sensitive") == 0) + gtk_widget_set_sensitive (tool_item->priv->menu_item, + GTK_WIDGET_SENSITIVE (tool_item)); +} + static void create_drag_window (GtkToolItem *toolitem) { @@ -1059,6 +1073,9 @@ gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item, { g_object_ref (menu_item); gtk_object_sink (GTK_OBJECT (menu_item)); + + gtk_widget_set_sensitive (menu_item, + GTK_WIDGET_SENSITIVE (tool_item)); } tool_item->priv->menu_item = menu_item;