diff options
author | louis <louis.braun@gmx.de> | 2013-12-21 11:25:03 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-12-21 11:25:03 +0100 |
commit | 4c61104675de5f1fac7e7fa95fb5743e18defc02 (patch) | |
tree | 7a3ee90e3b28246e8d4595954d4559445fb7ebe7 /channelgroup.c | |
parent | 8aa2c81d3165a0517115337362f1203ea4bdd899 (diff) | |
download | vdr-plugin-tvguide-4c61104675de5f1fac7e7fa95fb5743e18defc02.tar.gz vdr-plugin-tvguide-4c61104675de5f1fac7e7fa95fb5743e18defc02.tar.bz2 |
Version 1.2.0pre
Diffstat (limited to 'channelgroup.c')
-rw-r--r-- | channelgroup.c | 82 |
1 files changed, 47 insertions, 35 deletions
diff --git a/channelgroup.c b/channelgroup.c index 4008a67..3278f8c 100644 --- a/channelgroup.c +++ b/channelgroup.c @@ -37,50 +37,62 @@ void cChannelGroupGrid::SetBackground() { void cChannelGroupGrid::SetGeometry(int start, int end) {
int x, y, width, height;
if (tvguideConfig.displayMode == eVertical) {
- x = tvguideConfig.timeLineWidth + start*tvguideConfig.colWidth;
- y = tvguideConfig.statusHeaderHeight;
- width = (end - start + 1) * tvguideConfig.colWidth;
- height = tvguideConfig.channelGroupsHeight;
+ x = geoManager.timeLineWidth + start*geoManager.colWidth;
+ y = geoManager.statusHeaderHeight;
+ width = (end - start + 1) * geoManager.colWidth;
+ height = geoManager.channelGroupsHeight;
} else if (tvguideConfig.displayMode == eHorizontal) {
x = 0;
- y = tvguideConfig.statusHeaderHeight + tvguideConfig.timeLineHeight + start*tvguideConfig.rowHeight;
- width = tvguideConfig.channelGroupsWidth;
- height = (end - start + 1) * tvguideConfig.rowHeight;
+ y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + start*geoManager.rowHeight;
+ width = geoManager.channelGroupsWidth;
+ height = (end - start + 1) * geoManager.rowHeight;
}
pixmap = osdManager.requestPixmap(1, cRect(x, y, width, height));
}
void cChannelGroupGrid::Draw(void) {
- drawBackground();
- drawBorder();
+ if (tvguideConfig.style == eStyleGraphical) {
+ drawBackgroundGraphical(bgChannelGroup);
+ } else {
+ drawBackground();
+ drawBorder();
+ }
tColor colorText = theme.Color(clrFont);
- tColor colorTextBack = (tvguideConfig.useBlending==0)?color:clrTransparent;
+ tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
if (tvguideConfig.displayMode == eVertical) {
- int textY = (Height() - tvguideConfig.FontChannelGroups->Height()) / 2;
- cString text = CutText(name, Width() - 4, tvguideConfig.FontChannelGroups).c_str();
- int textWidth = tvguideConfig.FontChannelGroups->Width(*text);
- int x = (Width() - textWidth) / 2;
- pixmap->DrawText(cPoint(x, textY), *text, colorText, colorTextBack, tvguideConfig.FontChannelGroups);
+ DrawVertical(colorText, colorTextBack);
} else if (tvguideConfig.displayMode == eHorizontal) {
- std::string nameUpper = name;
- std::transform(nameUpper.begin(), nameUpper.end(),nameUpper.begin(), ::toupper);
- int numChars = nameUpper.length();
- int charHeight = tvguideConfig.FontChannelGroupsHorizontal->Height();
- int textHeight = numChars * charHeight;
- int y = 5;
- if ((textHeight +5) < Height()) {
- y = (Height() - textHeight) / 2;
- }
- for (int i=0; i < numChars; i++) {
- if (((y + 2*charHeight) > Height()) && ((i+1)<numChars)) {
- int x = (Width() - tvguideConfig.FontChannelGroupsHorizontal->Width("...")) / 2;
- pixmap->DrawText(cPoint(x, y), "...", colorText, colorTextBack, tvguideConfig.FontChannelGroupsHorizontal);
- break;
- }
- cString currentChar = cString::sprintf("%c", nameUpper.at(i));
- int x = (Width() - tvguideConfig.FontChannelGroupsHorizontal->Width(*currentChar)) / 2;
- pixmap->DrawText(cPoint(x, y), *currentChar, colorText, colorTextBack, tvguideConfig.FontChannelGroupsHorizontal);
- y += tvguideConfig.FontChannelGroupsHorizontal->Height();
+ DrawHorizontal(colorText, colorTextBack);
+ }
+}
+
+void cChannelGroupGrid::DrawVertical(tColor colorText, tColor colorTextBack) {
+ int textY = (Height() - fontManager.FontChannelGroups->Height()) / 2;
+ cString text = CutText(name, Width() - 4, fontManager.FontChannelGroups).c_str();
+ int textWidth = fontManager.FontChannelGroups->Width(*text);
+ int x = (Width() - textWidth) / 2;
+ pixmap->DrawText(cPoint(x, textY), *text, colorText, colorTextBack, fontManager.FontChannelGroups);
+}
+
+void cChannelGroupGrid::DrawHorizontal(tColor colorText, tColor colorTextBack) {
+ std::string nameUpper = name;
+ std::transform(nameUpper.begin(), nameUpper.end(),nameUpper.begin(), ::toupper);
+ int numChars = nameUpper.length();
+ int charHeight = fontManager.FontChannelGroupsHorizontal->Height();
+ int textHeight = numChars * charHeight;
+ int y = 5;
+ if ((textHeight +5) < Height()) {
+ y = (Height() - textHeight) / 2;
+ }
+ for (int i=0; i < numChars; i++) {
+ if (((y + 2*charHeight) > Height()) && ((i+1)<numChars)) {
+ int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width("...")) / 2;
+ pixmap->DrawText(cPoint(x, y), "...", colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
+ break;
}
+ cString currentChar = cString::sprintf("%c", nameUpper.at(i));
+ int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width(*currentChar)) / 2;
+ pixmap->DrawText(cPoint(x, y), *currentChar, colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
+ y += fontManager.FontChannelGroupsHorizontal->Height();
}
-}
\ No newline at end of file +}
|