[Xfce4-commits] <xfce4-panel:andrzejr/deskbar2> pager: changing orientation depending on the panel mode.

Andrzej noreply at xfce.org
Sun Jan 22 15:34:01 CET 2012


Updating branch refs/heads/andrzejr/deskbar2
         to ecdfc961119f9a1a71f28af2e6b9b6e0ae5bb423 (commit)
       from bfb2dac65d855d2ac4e2bccc84e1e1b4ad907f94 (commit)

commit ecdfc961119f9a1a71f28af2e6b9b6e0ae5bb423
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sun Jan 22 16:04:23 2012 +0900

    pager: changing orientation depending on the panel mode.

 plugins/pager/pager.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/plugins/pager/pager.c b/plugins/pager/pager.c
index 16e3d94..ae24173 100644
--- a/plugins/pager/pager.c
+++ b/plugins/pager/pager.c
@@ -57,8 +57,8 @@ static void     pager_plugin_construct                    (XfcePanelPlugin   *pa
 static void     pager_plugin_free_data                    (XfcePanelPlugin   *panel_plugin);
 static gboolean pager_plugin_size_changed                 (XfcePanelPlugin   *panel_plugin,
                                                            gint               size);
-static void     pager_plugin_orientation_changed          (XfcePanelPlugin   *panel_plugin,
-                                                           GtkOrientation     orientation);
+static void     pager_plugin_mode_changed                 (XfcePanelPlugin     *panel_plugin,
+                                                           XfcePanelPluginMode  mode);
 static void     pager_plugin_configure_workspace_settings (GtkWidget         *button);
 static void     pager_plugin_configure_plugin             (XfcePanelPlugin   *panel_plugin);
 static void     pager_plugin_screen_layout_changed        (PagerPlugin       *plugin);
@@ -118,7 +118,7 @@ pager_plugin_class_init (PagerPluginClass *klass)
   plugin_class->construct = pager_plugin_construct;
   plugin_class->free_data = pager_plugin_free_data;
   plugin_class->size_changed = pager_plugin_size_changed;
-  plugin_class->orientation_changed = pager_plugin_orientation_changed;
+  plugin_class->mode_changed = pager_plugin_mode_changed;
   plugin_class->configure_plugin = pager_plugin_configure_plugin;
 
   g_object_class_install_property (gobject_class,
@@ -286,7 +286,9 @@ pager_plugin_screen_layout_changed (PagerPlugin *plugin)
       wnck_screen_force_update (plugin->wnck_screen);
     }
 
-  orientation = xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin));
+  orientation =
+    (xfce_panel_plugin_get_mode (XFCE_PANEL_PLUGIN (plugin)) != XFCE_PANEL_PLUGIN_MODE_VERTICAL) ?
+    GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
 
   if (plugin->miniature_view)
     {
@@ -393,10 +395,15 @@ pager_plugin_size_changed (XfcePanelPlugin *panel_plugin,
 
 
 static void
-pager_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
-                                  GtkOrientation   orientation)
+pager_plugin_mode_changed (XfcePanelPlugin     *panel_plugin,
+                           XfcePanelPluginMode  mode)
 {
-  PagerPlugin *plugin = XFCE_PAGER_PLUGIN (panel_plugin);
+  PagerPlugin       *plugin = XFCE_PAGER_PLUGIN (panel_plugin);
+  GtkOrientation     orientation;
+
+  orientation =
+    (mode != XFCE_PANEL_PLUGIN_MODE_VERTICAL) ?
+    GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
 
   if (plugin->miniature_view)
     wnck_pager_set_orientation (WNCK_PAGER (plugin->pager), orientation);


More information about the Xfce4-commits mailing list