[Xfce4-commits] <xfce4-panel:devel> Merge branch 'master' into launcher

Nick Schermer nick at xfce.org
Tue Aug 11 20:26:42 CEST 2009


Updating branch refs/heads/devel
         to bb581443f94cbed2ff2b6d6fd7d4228661c4d459 (commit)
       from f5e0af0b8761c436c58d85feb7c4ee95f277a180 (commit)

commit bb581443f94cbed2ff2b6d6fd7d4228661c4d459
Merge: f5e0af0b8761c436c58d85feb7c4ee95f277a180 a9f6ab9d656c0c79c371d2f56250c6591628ba5e
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Feb 7 20:30:35 2009 +0100

    Merge branch 'master' into launcher

commit a9f6ab9d656c0c79c371d2f56250c6591628ba5e
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Feb 7 20:26:01 2009 +0100

    No I did not use copy/past... really...

commit 28b9687eef10a0e01c2c19b2b34ec7c8e45bd89a
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Feb 7 20:23:42 2009 +0100

    Propertly allocate the buttons when the orientation is vertical.

commit afcf36dcb8be9d3d5dcac3ef55486de4f1b1f49f
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Feb 7 20:23:10 2009 +0100

    Force the plugin to resize when the orientation changes.

 plugins/separator/separator.c      |   14 ++++++++++++++
 plugins/tasklist/tasklist-widget.c |   18 ++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/plugins/separator/separator.c b/plugins/separator/separator.c
index 78cfd4d..dfea7df 100644
--- a/plugins/separator/separator.c
+++ b/plugins/separator/separator.c
@@ -44,6 +44,8 @@ static gboolean separator_plugin_size_changed              (XfcePanelPlugin
                                                             gint                   size);
 static void     separator_plugin_save                      (XfcePanelPlugin       *panel_plugin);
 static void     separator_plugin_configure_plugin          (XfcePanelPlugin       *panel_plugin);
+static void     separator_plugin_orientation_changed       (XfcePanelPlugin       *panel_plugin,
+                                                            GtkOrientation         orientation);
 static void     separator_plugin_property_changed          (XfconfChannel         *channel,
                                                             const gchar           *property_name,
                                                             const GValue          *value,
@@ -109,6 +111,7 @@ separator_plugin_class_init (SeparatorPluginClass *klass)
   plugin_class->save = separator_plugin_save;
   plugin_class->size_changed = separator_plugin_size_changed;
   plugin_class->configure_plugin = separator_plugin_configure_plugin;
+  plugin_class->orientation_changed = separator_plugin_orientation_changed;
 }
 
 
@@ -313,6 +316,17 @@ separator_plugin_configure_plugin (XfcePanelPlugin *panel_plugin)
 
 
 static void
+separator_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
+                                      GtkOrientation   orientation)
+{
+  /* for a size change to set the widget size request properly */
+  separator_plugin_size_changed (panel_plugin, 
+                                 xfce_panel_plugin_get_size (panel_plugin));
+}
+
+
+
+static void
 separator_plugin_property_changed (XfconfChannel   *channel,
                                    const gchar     *property_name,
                                    const GValue    *value,
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 90a7f89..b896bad 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -487,8 +487,16 @@ xfce_tasklist_size_allocate (GtkWidget     *widget,
         continue;
 
       /* calculate the child position */
-      child_allocation.x = allocation->x + (i / rows) * width;
-      child_allocation.y = allocation->y + (i % rows) * height;
+      if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL)
+        {
+          child_allocation.x = allocation->x + (i / rows) * width;
+          child_allocation.y = allocation->y + (i % rows) * height;
+        }
+      else
+        {
+          child_allocation.x = allocation->x + (i % rows) * width;
+          child_allocation.y = allocation->y + (i / rows) * height;
+        }
 
       /* allocate the child */
       gtk_widget_size_allocate (child->button, &child_allocation);
@@ -1481,4 +1489,10 @@ xfce_tasklist_set_orientation (XfceTasklist   *tasklist,
                                GtkOrientation  orientation)
 {
   panel_return_if_fail (XFCE_IS_TASKLIST (tasklist));
+  
+  if (tasklist->orientation != orientation)
+    {
+      tasklist->orientation = orientation;
+      gtk_widget_queue_resize (GTK_WIDGET (tasklist));
+    }
 }



More information about the Xfce4-commits mailing list