[Xfce4-commits] <xfce4-panel:master> Pager: Changing orientation depending on the panel mode.

Nick Schermer noreply at xfce.org
Fri Feb 24 16:42:01 CET 2012


Updating branch refs/heads/master
         to 206af044ced329aaca338abe14b87bc71362ed82 (commit)
       from 8e15559b57e09d84e06312e54a1cb0a1eb8431fa (commit)

commit 206af044ced329aaca338abe14b87bc71362ed82
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