[Xfce4-commits] <xfce4-panel:devel> Connect handle property of the tasklist to xfconf.

Nick Schermer nick at xfce.org
Tue Aug 11 20:32:15 CEST 2009


Updating branch refs/heads/devel
         to d633bd020b54abd344add8a57ba098275a039519 (commit)
       from b621c056ac2f7408ac639742977964beca191d6d (commit)

commit d633bd020b54abd344add8a57ba098275a039519
Author: Nick Schermer <nick at xfce.org>
Date:   Mon May 18 18:37:05 2009 +0200

    Connect handle property of the tasklist to xfconf.

 plugins/tasklist/tasklist.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/plugins/tasklist/tasklist.c b/plugins/tasklist/tasklist.c
index ea1ea36..83ff681 100644
--- a/plugins/tasklist/tasklist.c
+++ b/plugins/tasklist/tasklist.c
@@ -108,7 +108,7 @@ tasklist_plugin_init (TasklistPlugin *plugin)
   gtk_widget_show (box);
 
   plugin->handle = gtk_alignment_new (0.00, 0.00, 0.00, 0.00);
-  gtk_box_pack_start (GTK_BOX (box), plugin->handle, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (box), plugin->handle, FALSE, FALSE, 0);
   g_signal_connect (G_OBJECT (plugin->handle), "expose-event",
       G_CALLBACK (tasklist_plugin_handle_expose_event), plugin);
   gtk_widget_set_size_request (plugin->handle, 8, 8);
@@ -144,6 +144,9 @@ tasklist_plugin_construct (XfcePanelPlugin *panel_plugin)
   TASKLIST_XFCONF_BIND ("show-only-minimized", G_TYPE_BOOLEAN)
   TASKLIST_XFCONF_BIND ("show-wireframes", G_TYPE_BOOLEAN)
 
+  xfconf_g_property_bind (plugin->channel, "/show-handle", G_TYPE_BOOLEAN,
+                          plugin->handle, "visible");
+
   /* show the tasklist */
   gtk_widget_show (plugin->tasklist);
 }
@@ -217,11 +220,13 @@ tasklist_plugin_configure_plugin (XfcePanelPlugin *panel_plugin)
 
 #define TASKLIST_DIALOG_BIND(name, property) \
       object = gtk_builder_get_object (builder, (name)); \
+      panel_return_if_fail (G_IS_OBJECT (object)); \
       exo_mutual_binding_new (G_OBJECT (plugin->tasklist), (name), \
                               G_OBJECT (object), (property));
 
 #define TASKLIST_DIALOG_BIND_INV(name, property) \
-      object = gtk_builder_get_object (builder, name); \
+      object = gtk_builder_get_object (builder, (name)); \
+      panel_return_if_fail (G_IS_OBJECT (object)); \
       exo_mutual_binding_new_with_negation (G_OBJECT (plugin->tasklist), \
                                             name,  G_OBJECT (object), \
                                             property);
@@ -234,6 +239,11 @@ tasklist_plugin_configure_plugin (XfcePanelPlugin *panel_plugin)
       TASKLIST_DIALOG_BIND ("show-only-minimized", "active")
       TASKLIST_DIALOG_BIND ("show-wireframes", "active")
 
+      object = gtk_builder_get_object (builder, "show-handle");
+      panel_return_if_fail (G_IS_OBJECT (object));
+      exo_mutual_binding_new (G_OBJECT (plugin->handle), "visible",
+                              G_OBJECT (object), "active");
+
       gtk_widget_show (GTK_WIDGET (dialog));
 	}
   else



More information about the Xfce4-commits mailing list