[Xfce4-commits] <xfce4-panel:master> Fix autohide direction based on orientation and edge.

Nick Schermer noreply at xfce.org
Sun Jan 23 20:26:02 CET 2011


Updating branch refs/heads/master
         to 15a5fa2fb459aa175e4b6f98e341bdff0395eccd (commit)
       from 5f703756fce60eb42396d6e6870abb82172d7e2f (commit)

commit 15a5fa2fb459aa175e4b6f98e341bdff0395eccd
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Jan 23 20:21:52 2011 +0100

    Fix autohide direction based on orientation and edge.
    
    When the panel is horizontal and snapped to the left or right
    border (not in a corner) is should hide sideways. Same when
    a vertical panel is snapped to the top or bottom of the screen.

 panel/panel-window.c |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/panel/panel-window.c b/panel/panel-window.c
index f8cd275..822c303 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -1159,10 +1159,33 @@ panel_window_size_allocate (GtkWidget     *widget,
 
       /* set hidden window size */
       w = h = 3;
-      if (window->horizontal)
-        w = alloc->width;
-      else
-        h = alloc->height;
+
+      switch (window->snap_position)
+        {
+        /* left or right of the screen */
+        case SNAP_POSITION_E:
+        case SNAP_POSITION_EC:
+        case SNAP_POSITION_W:
+        case SNAP_POSITION_WC:
+          h = alloc->height;
+          break;
+
+        /* top or bottom of the screen */
+        case SNAP_POSITION_NC:
+        case SNAP_POSITION_SC:
+        case SNAP_POSITION_N:
+        case SNAP_POSITION_S:
+          w = alloc->width;
+          break;
+
+        /* corner or floating panel */
+        default:
+          if (window->horizontal)
+            w = alloc->width;
+          else
+            h = alloc->height;
+          break;
+        }
 
       /* position the autohide window */
       panel_window_size_allocate_set_xy (window, w, h, &x, &y);



More information about the Xfce4-commits mailing list