summaryrefslogtreecommitdiff
path: root/footer.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-01-17 13:16:44 +0100
committerlouis <louis.braun@gmx.de>2013-01-17 13:16:44 +0100
commit47c3fea545a1b4607deda1e7d2fa51cbcf89a656 (patch)
tree4109469360bfb71ce467c240a33d0738ad44c18e /footer.c
downloadvdr-plugin-tvguide-47c3fea545a1b4607deda1e7d2fa51cbcf89a656.tar.gz
vdr-plugin-tvguide-47c3fea545a1b4607deda1e7d2fa51cbcf89a656.tar.bz2
Initial push tvguide 0.0.1
Diffstat (limited to 'footer.c')
-rw-r--r--footer.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/footer.c b/footer.c
new file mode 100644
index 0000000..19ee958
--- /dev/null
+++ b/footer.c
@@ -0,0 +1,59 @@
+#include "footer.h"
+
+cFooter::cFooter() {
+ int buttonHeight= tvguideConfig.footerHeight - 20;
+ textY = (buttonHeight - tvguideConfig.FontButton->Height())/2;
+ int distanceX = 20;
+ buttonWidth = (tvguideConfig.osdWidth - tvguideConfig.timeColWidth-5*distanceX)/4;
+ int startX = tvguideConfig.timeColWidth + distanceX;
+ int Y = tvguideConfig.osdHeight - tvguideConfig.footerHeight + (tvguideConfig.footerHeight - buttonHeight)/2;
+
+ buttonRed = new cStyledPixmap(osdManager.requestPixmap(3, cRect(startX, Y, buttonWidth, buttonHeight), cRect::Null, "btnRed"), "btnRed");
+ buttonGreen = new cStyledPixmap(osdManager.requestPixmap(3, cRect(startX + buttonWidth + distanceX, Y, buttonWidth, buttonHeight), cRect::Null, "btnGreen"), "btnGreen");
+ buttonYellow = new cStyledPixmap(osdManager.requestPixmap(3, cRect(startX + 2*(buttonWidth + distanceX), Y, buttonWidth, buttonHeight), cRect::Null, "btnYellow"), "btnYellow");
+ buttonBlue = new cStyledPixmap(osdManager.requestPixmap(3, cRect(startX + 3*(buttonWidth + distanceX), Y, buttonWidth, buttonHeight), cRect::Null, "btnBlue"), "btnBlue");
+}
+
+cFooter::~cFooter(void) {
+ delete buttonRed;
+ delete buttonGreen;
+ delete buttonYellow;
+ delete buttonBlue;
+}
+
+void cFooter::drawRedButton() {
+ buttonRed->setColor(theme.Color(clrButtonRed), theme.Color(clrButtonRedBlending));
+ buttonRed->drawBackground();
+ buttonRed->drawBorder();
+ cString text(tr("Set Timer"));
+ int width = tvguideConfig.FontButton->Width(*(text));
+ buttonRed->DrawText(cPoint((buttonWidth-width)/2, textY), *(text), theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton);
+
+}
+
+void cFooter::drawGreenButton() {
+ buttonGreen->setColor(theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBlending));
+ buttonGreen->drawBackground();
+ buttonGreen->drawBorder();
+ cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels back"));
+ int width = tvguideConfig.FontButton->Width(*text);
+ buttonGreen->DrawText(cPoint((buttonWidth-width)/2, textY), *text, theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton);
+}
+
+void cFooter::drawYellowButton() {
+ buttonYellow->setColor(theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBlending));
+ buttonYellow->drawBackground();
+ buttonYellow->drawBorder();
+ cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels forward"));
+ int width = tvguideConfig.FontButton->Width(*text);
+ buttonYellow->DrawText(cPoint((buttonWidth-width)/2, textY), *text, theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton);
+}
+
+void cFooter::drawBlueButton() {
+ buttonBlue->setColor(theme.Color(clrButtonBlue), theme.Color(clrButtonBlueBlending));
+ buttonBlue->drawBackground();
+ buttonBlue->drawBorder();
+ cString text(tr("Switch to Channel"));
+ int width = tvguideConfig.FontButton->Width(*(text));
+ buttonBlue->DrawText(cPoint((buttonWidth-width)/2, textY), *(text), theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton);
+}