summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-03-02 17:24:13 +0100
committerlouis <louis.braun@gmx.de>2013-03-02 17:24:13 +0100
commit23be956fbd196bf30623dd588e7326f7231d4517 (patch)
treebd5fb3f9662342f52c9110078a8278dd987644ee
parent949bf478ebbdc6dcb71c47f7b9a79516f741184e (diff)
downloadskin-nopacity-23be956fbd196bf30623dd588e7326f7231d4517.tar.gz
skin-nopacity-23be956fbd196bf30623dd588e7326f7231d4517.tar.bz2
rounded corners also for epg and recording images
-rw-r--r--HISTORY2
-rw-r--r--config.c2
-rw-r--r--imageloader.c1
-rw-r--r--menudetailview.c32
4 files changed, 36 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index 0e2d218..bfc47c6 100644
--- a/HISTORY
+++ b/HISTORY
@@ -147,3 +147,5 @@ Version 0.0.7:
plugin setup
- trying to load channel separator icon. It has to be named as the channel
separator in low letters. If no icon is found, a generic icon is used.
+- if rounded corners for menuitems are used, also epg images are drawn with
+ rounded corners with the same corner radius
diff --git a/config.c b/config.c
index 11dfdb9..9ce193c 100644
--- a/config.c
+++ b/config.c
@@ -104,7 +104,7 @@ cNopacityConfig::cNopacityConfig() {
timersLogoHeight = 70;
epgImageWidth = 210;
epgImageHeight = 160;
- epgImageWidthLarge = 545;
+ epgImageWidthLarge = 525;
epgImageHeightLarge = 400;
menuRecFolderSize = 128;
fontHeader = 0;
diff --git a/imageloader.c b/imageloader.c
index bfc4ce5..deaa782 100644
--- a/imageloader.c
+++ b/imageloader.c
@@ -1,4 +1,5 @@
#include "imageloader.h"
+#include "imageloader.h"
#include <math.h>
#include <string>
#include <dirent.h>
diff --git a/menudetailview.c b/menudetailview.c
index f2131e1..36165d2 100644
--- a/menudetailview.c
+++ b/menudetailview.c
@@ -197,6 +197,15 @@ void cNopacityMenuDetailEventView::DrawHeader(void) {
int widthTextHeader = width - 4 * border - logoWidth;
if (imgLoader.LoadEPGImage(event->EventID())) {
pixmapHeader->DrawImage(cPoint(width - config.epgImageWidth - border, (headerHeight-config.epgImageHeight)/2), imgLoader.GetImage());
+ if (config.roundedCorners) {
+ int radius = config.cornerRadius;
+ int x = width - config.epgImageWidth - border;
+ int y = (headerHeight-config.epgImageHeight)/2;
+ pixmapHeader->DrawEllipse(cRect(x,y,radius,radius), clrTransparent, -2);
+ pixmapHeader->DrawEllipse(cRect(x + config.epgImageWidth - radius,y,radius,radius), clrTransparent, -1);
+ pixmapHeader->DrawEllipse(cRect(x,y + config.epgImageHeight - radius,radius,radius), clrTransparent, -3);
+ pixmapHeader->DrawEllipse(cRect(x + config.epgImageWidth - radius,y + config.epgImageHeight - radius,radius,radius), clrTransparent, -4);
+ }
widthTextHeader -= config.epgImageWidth;
}
@@ -283,6 +292,13 @@ void cNopacityMenuDetailEventView::DrawEPGPictures(int height) {
cString epgimage = cString::sprintf("%d_%d", event->EventID(), i);
if (imgLoader.LoadAdditionalEPGImage(epgimage)) {
pixmapContent->DrawImage(cPoint(currentX, currentY), imgLoader.GetImage());
+ if (config.roundedCorners) {
+ int radius = config.cornerRadius;
+ pixmapContent->DrawEllipse(cRect(currentX,currentY,radius,radius), clrTransparent, -2);
+ pixmapContent->DrawEllipse(cRect(currentX + config.epgImageWidthLarge - radius,currentY,radius,radius), clrTransparent, -1);
+ pixmapContent->DrawEllipse(cRect(currentX,currentY + config.epgImageHeightLarge - radius,radius,radius), clrTransparent, -3);
+ pixmapContent->DrawEllipse(cRect(currentX + config.epgImageWidthLarge - radius,currentY + config.epgImageHeightLarge - radius,radius,radius), clrTransparent, -4);
+ }
if (currentPicsPerLine < picsPerLine) {
currentX += config.epgImageWidthLarge + border;
currentPicsPerLine++;
@@ -394,6 +410,13 @@ void cNopacityMenuDetailRecordingView::DrawEPGPictures(int height) {
cString epgimage = epgpics.at(i).c_str();
if (imgLoader.LoadAdditionalRecordingImage(path, epgimage)) {
pixmapContent->DrawImage(cPoint(currentX, currentY), imgLoader.GetImage());
+ if (config.roundedCorners) {
+ int radius = config.cornerRadius;
+ pixmapContent->DrawEllipse(cRect(currentX,currentY,radius,radius), clrTransparent, -2);
+ pixmapContent->DrawEllipse(cRect(currentX + config.epgImageWidthLarge - radius,currentY,radius,radius), clrTransparent, -1);
+ pixmapContent->DrawEllipse(cRect(currentX,currentY + config.epgImageHeightLarge - radius,radius,radius), clrTransparent, -3);
+ pixmapContent->DrawEllipse(cRect(currentX + config.epgImageWidthLarge - radius,currentY + config.epgImageHeightLarge - radius,radius,radius), clrTransparent, -4);
+ }
if (currentPicsPerLine < picsPerLine) {
currentX += config.epgImageWidthLarge + border;
currentPicsPerLine++;
@@ -422,6 +445,15 @@ void cNopacityMenuDetailRecordingView::DrawHeader(void) {
int widthTextHeader = width - 4 * border;
if (imgLoader.LoadRecordingImage(recording->FileName())) {
pixmapHeader->DrawImage(cPoint(width - config.epgImageWidth - border, (headerHeight-config.epgImageHeight)/2), imgLoader.GetImage());
+ if (config.roundedCorners) {
+ int radius = config.cornerRadius;
+ int x = width - config.epgImageWidth - border;
+ int y = (headerHeight-config.epgImageHeight)/2;
+ pixmapHeader->DrawEllipse(cRect(x,y,radius,radius), clrTransparent, -2);
+ pixmapHeader->DrawEllipse(cRect(x + config.epgImageWidth - radius,y,radius,radius), clrTransparent, -1);
+ pixmapHeader->DrawEllipse(cRect(x,y + config.epgImageHeight - radius,radius,radius), clrTransparent, -3);
+ pixmapHeader->DrawEllipse(cRect(x + config.epgImageWidth - radius,y + config.epgImageHeight - radius,radius,radius), clrTransparent, -4);
+ }
widthTextHeader -= config.epgImageWidth;
}
int lineHeight = fontHeaderLarge->Height();