diff options
Diffstat (limited to 'src/ArrowButton.cc')
-rw-r--r-- | src/ArrowButton.cc | 32 |
1 files changed, 21 insertions, 11 deletions
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 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: ArrowButton.cc,v 1.5 2003/10/13 23:51:04 fluxgen Exp $ | 22 | // $Id: ArrowButton.cc,v 1.6 2004/05/18 08:35:22 grubert Exp $ |
23 | 23 | ||
24 | #include "ArrowButton.hh" | 24 | #include "ArrowButton.hh" |
25 | 25 | ||
@@ -82,22 +82,32 @@ void ArrowButton::leaveNotifyEvent(XCrossingEvent &ce) { | |||
82 | */ | 82 | */ |
83 | void ArrowButton::drawArrow() { | 83 | void ArrowButton::drawArrow() { |
84 | XPoint pts[3]; | 84 | XPoint pts[3]; |
85 | unsigned int w = width() / 2; | 85 | unsigned int w = width(); |
86 | unsigned int h = height() / 2; | 86 | unsigned int h = height(); |
87 | // arrow size: half of the button | ||
88 | unsigned int ax = w / 2; | ||
89 | unsigned int ay = h / 2; | ||
87 | switch (m_arrow_type) { | 90 | switch (m_arrow_type) { |
88 | case LEFT: | 91 | case LEFT: |
89 | pts[0].x = w - 2; pts[0].y = h; | 92 | // start at the tip |
90 | pts[1].x = 4; pts[1].y = 2; | 93 | pts[0].x = (w / 2) - (ax / 2); pts[0].y = h / 2; |
91 | pts[2].x = 0; pts[2].y = -4; | 94 | pts[1].x = ax; pts[1].y = ay / 2; |
95 | pts[2].x = 0; pts[2].y = - ay; | ||
92 | break; | 96 | break; |
93 | case RIGHT: | 97 | case RIGHT: |
94 | pts[0].x = w - 2; pts[0].y = h - 2; | 98 | pts[0].x = (w / 2) + (ax / 2); pts[0].y = h / 2; |
95 | pts[1].x = 4; pts[1].y = 2; | 99 | pts[1].x = - ax; pts[1].y = ay / 2; |
96 | pts[2].x = -4; pts[2].y = 2; | 100 | pts[2].x = 0; pts[2].y = - ay; |
97 | break; | 101 | break; |
98 | case UP: // TODO | 102 | case UP: |
103 | pts[0].x = (w / 2); pts[0].y = (h / 2) - (ay / 2); | ||
104 | pts[1].x = ax / 2; pts[1].y = ay; | ||
105 | pts[2].x = - ax; pts[2].y = 0; | ||
99 | break; | 106 | break; |
100 | case DOWN: // TODO | 107 | case DOWN: |
108 | pts[0].x = (w / 2); pts[0].y = (h / 2) + (ay / 2); | ||
109 | pts[1].x = ax / 2; pts[1].y = - ay; | ||
110 | pts[2].x = - ax; pts[2].y = 0; | ||
101 | break; | 111 | break; |
102 | } | 112 | } |
103 | 113 | ||