diff options
author | grubert <grubert> | 2004-05-18 08:35:22 (GMT) |
---|---|---|
committer | grubert <grubert> | 2004-05-18 08:35:22 (GMT) |
commit | b13f59e753de9b8f69c35f325afe3d3603272701 (patch) | |
tree | 0f43986c5daa57040001d2b336407c11c4e9c7b8 /src | |
parent | 0583166a150d06e1281392ec65821eb06fa0a374 (diff) | |
download | fluxbox-b13f59e753de9b8f69c35f325afe3d3603272701.zip fluxbox-b13f59e753de9b8f69c35f325afe3d3603272701.tar.bz2 |
Make arrows in buttons half the size of the button.
Add UP and DOWN arrows.
Diffstat (limited to 'src')
-rw-r--r-- | src/ArrowButton.cc | 32 | ||||
-rw-r--r-- | src/ToolFactory.cc | 3 |
2 files changed, 23 insertions, 12 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 | ||
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 @@ | |||
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: ToolFactory.cc,v 1.3 2004/01/11 16:09:50 fluxgen Exp $ | 22 | // $Id: ToolFactory.cc,v 1.4 2004/05/18 08:35:22 grubert Exp $ |
23 | 23 | ||
24 | #include "ToolFactory.hh" | 24 | #include "ToolFactory.hh" |
25 | 25 | ||
@@ -108,6 +108,7 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow & | |||
108 | if (*cmd == 0) // we need a command | 108 | if (*cmd == 0) // we need a command |
109 | return 0; | 109 | return 0; |
110 | 110 | ||
111 | // TODO maybe direction of arrows should depend on toolbar layout ? | ||
111 | ArrowButton::Type arrow_type = ArrowButton::LEFT; | 112 | ArrowButton::Type arrow_type = ArrowButton::LEFT; |
112 | if (name == "nextworkspace") | 113 | if (name == "nextworkspace") |
113 | arrow_type = ArrowButton::RIGHT; | 114 | arrow_type = ArrowButton::RIGHT; |