From b13f59e753de9b8f69c35f325afe3d3603272701 Mon Sep 17 00:00:00 2001
From: grubert <grubert>
Date: Tue, 18 May 2004 08:35:22 +0000
Subject: Make arrows in buttons half the size of the button. Add UP and DOWN
 arrows.

---
 ChangeLog          |  3 +++
 src/ArrowButton.cc | 32 +++++++++++++++++++++-----------
 src/ToolFactory.cc |  3 ++-
 3 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e1346b5..0ed0b95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 (Format: Year/Month/Day)
 Changes for 0.9.10:
+*04/05/18:
+  * Make the size of arrows in buttons half the button size (grubert).
+  * Add UP and DOWN buttons.
 *04/05/17:
   * Fix rendering of transparency on menu exposes (Simon)
     - also enable save unders for menu windows
diff --git a/src/ArrowButton.cc b/src/ArrowButton.cc
index 18dc6c6..38d6e74 100644
--- a/src/ArrowButton.cc
+++ b/src/ArrowButton.cc
@@ -19,7 +19,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: ArrowButton.cc,v 1.5 2003/10/13 23:51:04 fluxgen Exp $
+// $Id: ArrowButton.cc,v 1.6 2004/05/18 08:35:22 grubert Exp $
 
 #include "ArrowButton.hh"
 
@@ -82,22 +82,32 @@ void ArrowButton::leaveNotifyEvent(XCrossingEvent &ce) {
 */
 void ArrowButton::drawArrow() {
     XPoint pts[3];
-    unsigned int w = width() / 2;
-    unsigned int h = height() / 2;
+    unsigned int w = width();
+    unsigned int h = height();
+	// arrow size: half of the button
+	unsigned int ax = w / 2;
+	unsigned int ay = h / 2;
     switch (m_arrow_type) {
     case LEFT:
-        pts[0].x = w - 2; pts[0].y = h;
-        pts[1].x = 4; pts[1].y = 2;
-        pts[2].x = 0; pts[2].y = -4;
+		// start at the tip
+        pts[0].x = (w / 2) - (ax / 2); pts[0].y = h / 2;
+        pts[1].x = ax; pts[1].y = ay / 2;
+        pts[2].x = 0; pts[2].y = - ay;
         break;
     case RIGHT:
-        pts[0].x = w - 2; pts[0].y = h - 2;
-        pts[1].x = 4; pts[1].y = 2;
-        pts[2].x = -4; pts[2].y = 2;
+        pts[0].x = (w / 2) + (ax / 2); pts[0].y = h / 2;
+        pts[1].x = - ax; pts[1].y = ay / 2;
+        pts[2].x = 0; pts[2].y = - ay;
         break;
-    case UP: // TODO
+    case UP:
+        pts[0].x = (w / 2); pts[0].y = (h / 2) - (ay / 2);
+        pts[1].x = ax / 2; pts[1].y = ay;
+        pts[2].x = - ax; pts[2].y = 0;
         break;
-    case DOWN: // TODO
+    case DOWN:
+        pts[0].x = (w / 2); pts[0].y = (h / 2) + (ay / 2);
+        pts[1].x = ax / 2; pts[1].y = - ay;
+        pts[2].x = - ax; pts[2].y = 0;
         break;
     }
 
diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc
index 5383ed2..f3c66eb 100644
--- a/src/ToolFactory.cc
+++ b/src/ToolFactory.cc
@@ -19,7 +19,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: ToolFactory.cc,v 1.3 2004/01/11 16:09:50 fluxgen Exp $
+// $Id: ToolFactory.cc,v 1.4 2004/05/18 08:35:22 grubert Exp $
 
 #include "ToolFactory.hh"
 
@@ -108,6 +108,7 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &
         if (*cmd == 0) // we need a command
             return 0;
 
+		// TODO maybe direction of arrows should depend on toolbar layout ?
         ArrowButton::Type arrow_type = ArrowButton::LEFT;
         if (name == "nextworkspace")
             arrow_type = ArrowButton::RIGHT;
-- 
cgit v0.11.2