[Xfce4-commits] <xfce4-notes-plugin:master> Display left/right resize cursors in Xnp.Window

Mike Massonnet noreply at xfce.org
Thu Dec 17 17:30:01 CET 2009


Updating branch refs/heads/master
         to 3e71f8a27a9fa9ec1f9add163500fb28f332dbd9 (commit)
       from ca932f2b4dae96d6dbed6fd17021fd89d8931fab (commit)

commit 3e71f8a27a9fa9ec1f9add163500fb28f332dbd9
Author: Mike Massonnet <mmassonnet at gmail.com>
Date:   Thu Dec 17 15:19:25 2009 +0100

    Display left/right resize cursors in Xnp.Window

 ChangeLog                |    4 ++++
 panel-plugin/window.vala |   13 ++++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c6ad77b..197a099 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-17  Mike Massonnet <mmassonnet at xfce.org>
+
+Display left/right resize cursors in Xnp.Window
+
 2009-12-16  Mike Massonnet <mmassonnet at xfce.org>
 
 Update 2 bits in the TODO file
diff --git a/panel-plugin/window.vala b/panel-plugin/window.vala
index fb2f805..b9aa02f 100644
--- a/panel-plugin/window.vala
+++ b/panel-plugin/window.vala
@@ -71,6 +71,8 @@ namespace Xnp {
 		};
 
 		private int CORNER_MARGIN = 20;
+		private Gdk.Cursor CURSOR_RIGHT = new Gdk.Cursor (Gdk.CursorType.RIGHT_SIDE);
+		private Gdk.Cursor CURSOR_LEFT = new Gdk.Cursor (Gdk.CursorType.LEFT_SIDE);
 		private Gdk.Cursor CURSOR_BOTTOM_RC = new Gdk.Cursor (Gdk.CursorType.BOTTOM_RIGHT_CORNER);
 		private Gdk.Cursor CURSOR_BOTTOM = new Gdk.Cursor (Gdk.CursorType.BOTTOM_SIDE);
 		private Gdk.Cursor CURSOR_BOTTOM_LC = new Gdk.Cursor (Gdk.CursorType.BOTTOM_LEFT_CORNER);
@@ -442,8 +444,13 @@ namespace Xnp {
 				return false;
 			}
 
-			// Bottom right corner
+			// Right
 			if (event.x >= allocation.width - this.CORNER_MARGIN
+				&& event.y >= this.CORNER_MARGIN
+				&& event.y < allocation.height - this.CORNER_MARGIN)
+				window.set_cursor (this.CURSOR_RIGHT);
+			// Bottom right corner
+			else if (event.x >= allocation.width - this.CORNER_MARGIN
 				&& event.y >= allocation.height - this.CORNER_MARGIN)
 				window.set_cursor (this.CURSOR_BOTTOM_RC);
 			// Bottom
@@ -455,6 +462,10 @@ namespace Xnp {
 			else if (event.x <= this.CORNER_MARGIN
 				&& event.y >= allocation.height - this.CORNER_MARGIN)
 				window.set_cursor (this.CURSOR_BOTTOM_LC);
+			// Left
+			else if (event.x <= this.CORNER_MARGIN && event.y >= this.CORNER_MARGIN
+				&& event.y < allocation.height - this.CORNER_MARGIN)
+				window.set_cursor (this.CURSOR_LEFT);
 			// Default
 			else
 				window.set_cursor (null);



More information about the Xfce4-commits mailing list