summaryrefslogtreecommitdiff
path: root/displaymenuview.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-02-12 16:37:59 +0100
committerlouis <louis.braun@gmx.de>2013-02-12 16:37:59 +0100
commit702f4d7795fa97d0cb716c7933f83225e85a35e0 (patch)
treee70b222b47e327ec46b3a332bb3043a315dd70b4 /displaymenuview.c
parentf04a7865cdab7a6a8d0aa5ec2f062e16bcd27e8e (diff)
downloadskin-nopacity-702f4d7795fa97d0cb716c7933f83225e85a35e0.tar.gz
skin-nopacity-702f4d7795fa97d0cb716c7933f83225e85a35e0.tar.bz2
Introduced rounded corners for menuitems and buttons
Diffstat (limited to 'displaymenuview.c')
-rw-r--r--displaymenuview.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/displaymenuview.c b/displaymenuview.c
index 26975ab..a9435dc 100644
--- a/displaymenuview.c
+++ b/displaymenuview.c
@@ -607,6 +607,23 @@ void cNopacityDisplayMenuView::DrawButton(const char *text, int handleImage, tCo
int left = num * buttonWidth + (2*num + 1) * buttonsBorder;
pixmapFooter->DrawRectangle(cRect(left, top, buttonWidth, buttonHeight), borderColor);
pixmapFooter->DrawImage(cPoint(left+2, top+2), handleImage);
+
+ if (config.roundedCorners) {
+ int radius = config.cornerRadius;
+
+ pixmapFooter->DrawEllipse(cRect(left,top,radius,radius), borderColor, -2);
+ pixmapFooter->DrawEllipse(cRect(left-2,top-2,radius,radius), Theme.Color(clrMenuBack), -2);
+
+ pixmapFooter->DrawEllipse(cRect(left + buttonWidth -radius, top,radius,radius), borderColor, -1);
+ pixmapFooter->DrawEllipse(cRect(left + buttonWidth -radius+2,top-2,radius,radius), Theme.Color(clrMenuBack), -1);
+
+ pixmapFooter->DrawEllipse(cRect(left,top + buttonHeight -radius,radius,radius), borderColor, -3);
+ pixmapFooter->DrawEllipse(cRect(left - 2, top + buttonHeight - radius + 2,radius,radius), Theme.Color(clrMenuBack), -3);
+
+ pixmapFooter->DrawEllipse(cRect(left + buttonWidth -radius, top + buttonHeight -radius,radius,radius), borderColor, -4);
+ pixmapFooter->DrawEllipse(cRect(left + buttonWidth -radius + 2, top + buttonHeight -radius + 2,radius,radius), Theme.Color(clrMenuBack), -4);
+ }
+
int textWidth = fontButtons->Width(text);
int textHeight = fontButtons->Height();
pixmapFooter->DrawText(cPoint(left + (buttonWidth-textWidth)/2, top + (buttonHeight-textHeight)/2), text, Theme.Color(clrMenuFontButton), clrTransparent, fontButtons);