aboutsummaryrefslogtreecommitdiff
path: root/src/WinButton.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2007-01-06 07:38:04 (GMT)
committersimonb <simonb>2007-01-06 07:38:04 (GMT)
commit1f7b12cc494e8b492bd87207246265070b70d578 (patch)
tree7923939f792e790913548f684cf7ea57095c7626 /src/WinButton.cc
parent2e438fde2c4c6f660649c69f05681d50c72f849e (diff)
downloadfluxbox_pavel-1f7b12cc494e8b492bd87207246265070b70d578.zip
fluxbox_pavel-1f7b12cc494e8b492bd87207246265070b70d578.tar.bz2
move triangle drawing into FbDrawable
Make MenuItem triangles proportional
Diffstat (limited to 'src/WinButton.cc')
-rw-r--r--src/WinButton.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/WinButton.cc b/src/WinButton.cc
index f8421b5..f690f93 100644
--- a/src/WinButton.cc
+++ b/src/WinButton.cc
@@ -265,20 +265,21 @@ void WinButton::drawType() {
265 break; 265 break;
266 case SHADE: 266 case SHADE:
267 267
268 drawRectangle(gc(), 2, 2, width() - 5 - oddW, 2); 268 {
269 int size = width() - 5 - oddW;
270
271 drawRectangle(gc(), 2, 2, size, 2);
269 272
270 XPoint points[3]; 273 // draw a one-quarter triangle below the rectangle
271 if (m_listen_to.isShaded()) { 274 drawTriangle(gc(), (m_listen_to.isShaded() ?
272 points[1].x = (width() / 2) - 3; points[1].y = 7; 275 FbTk::FbDrawable::DOWN:
273 points[2].x = (width() / 2) + 4 - oddW; points[2].y = 7; 276 FbTk::FbDrawable::UP),
274 points[0].x = (width() / 2); points[0].y = height() / 2 + 2; 277 4, 6,
275 } else { 278 size-2, size/2 - 1,
276 points[0].x = (width() / 2); points[0].y = 6; 279 100);
277 points[1].x = (width() / 2) - 4; points[1].y = height() / 2 + 2; 280
278 points[2].x = (width() / 2) + 4 - oddW; points[2].y = height() / 2 + 2;
279 }
280 fillPolygon(gc(), points, 3, Convex, CoordModeOrigin);
281 break; 281 break;
282 }
282 case MENUICON: 283 case MENUICON:
283 if (m_icon_pixmap.drawable()) { 284 if (m_icon_pixmap.drawable()) {
284 285