summaryrefslogtreecommitdiff
path: root/timeline.c
diff options
context:
space:
mode:
Diffstat (limited to 'timeline.c')
-rw-r--r--timeline.c53
1 files changed, 49 insertions, 4 deletions
diff --git a/timeline.c b/timeline.c
index 4355352..fbbff62 100644
--- a/timeline.c
+++ b/timeline.c
@@ -7,7 +7,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
tvguideConfig.statusHeaderHeight,
tvguideConfig.timeLineWidth,
tvguideConfig.channelHeaderHeight + tvguideConfig.channelGroupsHeight)));
- timeline = osdManager.requestPixmap(1, cRect(0,
+ timeline = osdManager.requestPixmap(2, cRect(0,
tvguideConfig.statusHeaderHeight + tvguideConfig.channelHeaderHeight + tvguideConfig.channelGroupsHeight,
tvguideConfig.timeLineWidth,
tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.channelHeaderHeight - tvguideConfig.channelGroupsHeight - tvguideConfig.footerHeight)
@@ -15,12 +15,16 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
0,
tvguideConfig.timeLineWidth,
1440*tvguideConfig.minutePixel));
+ timelineBack = osdManager.requestPixmap(1, cRect(0,
+ tvguideConfig.statusHeaderHeight + tvguideConfig.channelHeaderHeight + tvguideConfig.channelGroupsHeight,
+ tvguideConfig.timeLineWidth,
+ tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.channelHeaderHeight - tvguideConfig.channelGroupsHeight - tvguideConfig.footerHeight));
} else if (tvguideConfig.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
tvguideConfig.statusHeaderHeight,
tvguideConfig.channelHeaderWidth + tvguideConfig.channelGroupsWidth,
- tvguideConfig.timeLineHeight)));
- timeline = osdManager.requestPixmap(1, cRect(tvguideConfig.channelHeaderWidth + tvguideConfig.channelGroupsWidth,
+ tvguideConfig.timeLineHeight-2)));
+ timeline = osdManager.requestPixmap(2, cRect(tvguideConfig.channelHeaderWidth + tvguideConfig.channelGroupsWidth,
tvguideConfig.statusHeaderHeight,
tvguideConfig.osdWidth - tvguideConfig.channelHeaderWidth - tvguideConfig.channelGroupsWidth,
tvguideConfig.timeLineHeight)
@@ -28,6 +32,10 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
0,
1440*tvguideConfig.minutePixel,
tvguideConfig.timeLineWidth));
+ timelineBack = osdManager.requestPixmap(1, cRect(tvguideConfig.channelHeaderWidth + tvguideConfig.channelGroupsWidth,
+ tvguideConfig.statusHeaderHeight,
+ tvguideConfig.osdWidth - tvguideConfig.channelHeaderWidth - tvguideConfig.channelGroupsWidth,
+ tvguideConfig.timeLineHeight));
}
clock = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
tvguideConfig.osdHeight- tvguideConfig.footerHeight,
@@ -38,6 +46,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
cTimeLine::~cTimeLine(void) {
delete dateViewer;
osdManager.releasePixmap(timeline);
+ osdManager.releasePixmap(timelineBack);
if (clock)
delete clock;
}
@@ -65,6 +74,7 @@ void cTimeLine::drawDateViewer() {
}
void cTimeLine::drawTimeline() {
+ timelineBack->Fill(clrBlack);
timeline->SetTile(true);
timeline->Fill(theme.Color(clrBackground));
tColor colorFont, colorBackground;
@@ -117,12 +127,14 @@ void cTimeLine::drawTimeline() {
if (tvguideConfig.displayMode == eVertical) {
posY = i*tvguideConfig.minutePixel*30;
timeline->DrawImage(cPoint(2, posY), *img);
+ decorateTile(0, posY, imgWidth+2, imgHeight);
textWidth = tvguideConfig.FontTimeLineTime->Width(timetext);
timeline->DrawText(cPoint((tvguideConfig.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, colorBackground, tvguideConfig.FontTimeLineTime);
} else if (tvguideConfig.displayMode == eHorizontal) {
posX = i*tvguideConfig.minutePixel*30;
timeline->DrawImage(cPoint(posX, 2), *img);
- timeline->DrawText(cPoint(posX + 2, (dateViewer->Height() - tvguideConfig.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, tvguideConfig.FontTimeLineTimeHorizontal);
+ decorateTile(posX, 0, imgWidth, imgHeight+2);
+ timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - tvguideConfig.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, tvguideConfig.FontTimeLineTimeHorizontal);
}
}
setTimeline();
@@ -130,6 +142,39 @@ void cTimeLine::drawTimeline() {
delete img2;
}
+void cTimeLine::decorateTile(int posX, int posY, int tileWidth, int tileHeight) {
+ timeline->DrawRectangle(cRect(posX,posY,tileWidth,2), theme.Color(clrBackground)); //top
+ timeline->DrawRectangle(cRect(posX,posY,2,tileHeight), theme.Color(clrBackground)); //left
+ timeline->DrawRectangle(cRect(posX,posY + tileHeight-2,tileWidth,2), theme.Color(clrBackground)); //bottom
+ timeline->DrawRectangle(cRect(posX + tileWidth-2,posY,2,tileHeight), theme.Color(clrBackground)); //right
+
+ timeline->DrawRectangle(cRect(2+posX,posY+2,tileWidth-4,1), theme.Color(clrBorder)); //top
+ timeline->DrawRectangle(cRect(2+posX,posY+2,1,tileHeight-4), theme.Color(clrBorder)); //left
+ timeline->DrawRectangle(cRect(2+posX,posY+tileHeight-3,tileWidth-4,1), theme.Color(clrBorder)); //bottom
+ timeline->DrawRectangle(cRect(posX+tileWidth-3,posY+2,1,tileHeight-4), theme.Color(clrBorder)); //right
+
+ if (tvguideConfig.roundedCorners) {
+ int borderRadius = 12;
+ drawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius);
+ }
+}
+
+void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, int radius) {
+ timeline->DrawEllipse(cRect(posX+2,posY+2,radius,radius), theme.Color(clrBorder), -2);
+ timeline->DrawEllipse(cRect(posX+1,posY+1,radius,radius), theme.Color(clrBackground), -2);
+
+ timeline->DrawEllipse(cRect(posX+width-radius - 2,posY+2,radius,radius), theme.Color(clrBorder), -1);
+ timeline->DrawEllipse(cRect(posX+width-radius - 1,posY+1,radius,radius), theme.Color(clrBackground), -1);
+
+ if( height > 2*radius) {
+ timeline->DrawEllipse(cRect(posX+2,posY+height-radius - 2,radius,radius), theme.Color(clrBorder), -3);
+ timeline->DrawEllipse(cRect(posX+1,posY+height-radius - 1,radius,radius), theme.Color(clrBackground), -3);
+
+ timeline->DrawEllipse(cRect(posX+width-radius - 2,posY+height-radius - 2,radius,radius), theme.Color(clrBorder), -4);
+ timeline->DrawEllipse(cRect(posX+width-radius - 1,posY+height-radius - 1,radius,radius), theme.Color(clrBackground), -4);
+ }
+}
+
cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = NULL;
if (tvguideConfig.useBlending == 1) {