summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-12-27 17:06:49 +0100
committerlouis <louis.braun@gmx.de>2013-12-27 17:06:49 +0100
commit3e5aec21172907f897ab68abfd2e22fc57e587c0 (patch)
tree8e401e323a599084fab195478d4aa5db88007fd9
parentc5af8c801775819dd9eed003883cb9cea2ef7376 (diff)
downloadvdr-plugin-tvguide-3e5aec21172907f897ab68abfd2e22fc57e587c0.tar.gz
vdr-plugin-tvguide-3e5aec21172907f897ab68abfd2e22fc57e587c0.tar.bz2
Rounded Corners for color buttons (Closes Ticket 1475)
-rw-r--r--HISTORY1
-rw-r--r--footer.c12
-rw-r--r--themes/tvguide-iceblue.theme8
-rw-r--r--tools.c18
-rw-r--r--tools.h1
5 files changed, 35 insertions, 5 deletions
diff --git a/HISTORY b/HISTORY
index 70c973b..be50ba6 100644
--- a/HISTORY
+++ b/HISTORY
@@ -93,3 +93,4 @@ Version 1.1.0
- Fixed Bug 1484
- Added Event Short Text (if available) to RecName (Closes Ticket 1490)
- Fixed OSD Background Color (Closes Ticket 1474)
+- Rounded Corners for color buttons (Closes Ticket 1475)
diff --git a/footer.c b/footer.c
index 2014905..348da30 100644
--- a/footer.c
+++ b/footer.c
@@ -102,6 +102,11 @@ void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOs
imgLoader.DrawBackground(theme.Color(clrButtonBlend), color, geoManager.buttonWidth-4, geoManager.buttonHeight-4);
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);
footer->DrawImage(cPoint(left+2, buttonY+2), imgLoader.GetImage());
+ if (tvguideConfig.roundedCorners) {
+ int borderRadius = 12;
+ int borderWidth = 2;
+ DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor);
+ }
} else if (tvguideConfig.style == eStyleGraphical) {
cImage *button = imgCache.GetOsdElement(buttonType);
if (button) {
@@ -109,7 +114,12 @@ void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOs
}
} else {
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);
- footer->DrawRectangle(cRect(left+2, buttonY+2, geoManager.buttonWidth-4, geoManager.buttonHeight-4), color);
+ footer->DrawRectangle(cRect(left+1, buttonY+1, geoManager.buttonWidth-2, geoManager.buttonHeight-2), color);
+ if (tvguideConfig.roundedCorners) {
+ int borderRadius = 12;
+ int borderWidth = 1;
+ DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor);
+ }
}
int textWidth = fontManager.FontButton->Width(text);
diff --git a/themes/tvguide-iceblue.theme b/themes/tvguide-iceblue.theme
index ce60ded..7da7143 100644
--- a/themes/tvguide-iceblue.theme
+++ b/themes/tvguide-iceblue.theme
@@ -18,13 +18,13 @@ clrTimeline1Blending = 00000000
clrTimeline2 = FF000000
clrTimeline2Blending = 00000000
clrButtonRed = FFBB0000
-clrButtonRedBorder = FFBB0000
+clrButtonRedBorder = FF000000
clrButtonGreen = FF00BB00
-clrButtonGreenBorder = FF00BB00
+clrButtonGreenBorder = FF000000
clrButtonYellow = FFBBBB00
-clrButtonYellowBorder = FFBBBB00
+clrButtonYellowBorder = FF000000
clrButtonBlue = FF0000BB
-clrButtonBlueBorder = FF0000BB
+clrButtonBlueBorder = FF000000
clrRecMenuBackground = AA000000
clrRecMenuTimerConflictBackground = FFCCCCCC
clrRecMenuTimerConflictBar = FF222222
diff --git a/tools.c b/tools.c
index 92fb4a8..d22f6b0 100644
--- a/tools.c
+++ b/tools.c
@@ -5,6 +5,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include <vdr/osd.h>
#include "tools.h"
@@ -51,6 +52,23 @@ std::string StrToLowerCase(std::string str) {
return lowerCase;
}
+void DrawRoundedCorners(cPixmap *p, int posX, int posY, int width, int height, int radius, int borderWidth, tColor borderColor) {
+ if( height > 2*radius) {
+ p->DrawEllipse(cRect(posX, posY, radius, radius), borderColor, -2);
+ p->DrawEllipse(cRect(posX - borderWidth, posY - borderWidth, radius, radius), clrTransparent, -2);
+
+ p->DrawEllipse(cRect(posX+width - radius, posY, radius, radius), borderColor, -1);
+ p->DrawEllipse(cRect(posX+width - radius + borderWidth, posY - borderWidth, radius, radius), clrTransparent, -1);
+
+ p->DrawEllipse(cRect(posX, posY + height - radius, radius, radius), borderColor, -3);
+ p->DrawEllipse(cRect(posX - borderWidth, posY + height - radius + borderWidth, radius, radius), clrTransparent, -3);
+
+ p->DrawEllipse(cRect(posX + width - radius, posY + height - radius, radius, radius), borderColor, -4);
+ p->DrawEllipse(cRect(posX + width - radius + borderWidth, posY + height - radius + borderWidth, radius, radius), clrTransparent, -4);
+ }
+}
+
+
/****************************************************************************************
* SPLTSTRING
****************************************************************************************/
diff --git a/tools.h b/tools.h
index f17bb9c..fd0a768 100644
--- a/tools.h
+++ b/tools.h
@@ -7,6 +7,7 @@
std::string CutText(std::string text, int width, const cFont *font);
std::string StrToLowerCase(std::string str);
+void DrawRoundedCorners(cPixmap *p, int posX, int posY, int width, int height, int radius, int borderWidth, tColor borderColor);
class splitstring : public std::string {
std::vector<std::string> flds;