diff options
author | simonb <simonb> | 2007-01-06 07:38:04 (GMT) |
---|---|---|
committer | simonb <simonb> | 2007-01-06 07:38:04 (GMT) |
commit | 1f7b12cc494e8b492bd87207246265070b70d578 (patch) | |
tree | 7923939f792e790913548f684cf7ea57095c7626 /src/FbTk/MenuItem.cc | |
parent | 2e438fde2c4c6f660649c69f05681d50c72f849e (diff) | |
download | fluxbox_paul-1f7b12cc494e8b492bd87207246265070b70d578.zip fluxbox_paul-1f7b12cc494e8b492bd87207246265070b70d578.tar.bz2 |
move triangle drawing into FbDrawable
Make MenuItem triangles proportional
Diffstat (limited to 'src/FbTk/MenuItem.cc')
-rw-r--r-- | src/FbTk/MenuItem.cc | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/FbTk/MenuItem.cc b/src/FbTk/MenuItem.cc index fafedc0..a2c3fe2 100644 --- a/src/FbTk/MenuItem.cc +++ b/src/FbTk/MenuItem.cc | |||
@@ -216,26 +216,13 @@ void MenuItem::draw(FbDrawable &draw, | |||
216 | break; | 216 | break; |
217 | 217 | ||
218 | case MenuTheme::TRIANGLE: | 218 | case MenuTheme::TRIANGLE: |
219 | XPoint tri[3]; | 219 | draw.drawTriangle(gc, ((theme.bulletPos() == FbTk::RIGHT)? |
220 | 220 | FbTk::FbDrawable::RIGHT: | |
221 | if (theme.bulletPos() == FbTk::RIGHT) { | 221 | FbTk::FbDrawable::LEFT), |
222 | tri[0].x = sel_x + half_w - 2; | 222 | sel_x, sel_y, |
223 | tri[0].y = sel_y + half_w - 2; | 223 | item_pm_height, |
224 | tri[1].x = 4; | 224 | item_pm_height, |
225 | tri[1].y = 2; | 225 | 300); // 33% triangle |
226 | tri[2].x = -4; | ||
227 | tri[2].y = 2; | ||
228 | } else { // point the other way | ||
229 | tri[0].x = sel_x + half_w - 2; | ||
230 | tri[0].y = sel_y + half_w; | ||
231 | tri[1].x = 4; | ||
232 | tri[1].y = 2; | ||
233 | tri[2].x = 0; | ||
234 | tri[2].y = -4; | ||
235 | } | ||
236 | |||
237 | draw.fillPolygon(gc, tri, 3, Convex, | ||
238 | CoordModePrevious); | ||
239 | break; | 226 | break; |
240 | 227 | ||
241 | case MenuTheme::DIAMOND: | 228 | case MenuTheme::DIAMOND: |