summaryrefslogtreecommitdiff
path: root/recmenuitem.c
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-07-04 14:17:08 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-07-05 14:51:21 +0200
commit463b6369d2e71c7a80885e31287aa22798caf1f3 (patch)
tree9d97161eaee698d650c359d800ea406aca5f0111 /recmenuitem.c
parent0b37464dd08361f3cc8ac2a3ee25a068418c4419 (diff)
downloadvdr-plugin-tvguide-463b6369d2e71c7a80885e31287aa22798caf1f3.tar.gz
vdr-plugin-tvguide-463b6369d2e71c7a80885e31287aa22798caf1f3.tar.bz2
Fixed dayOfWeek error in RecMenuSearchTimerEdit
Diffstat (limited to 'recmenuitem.c')
-rw-r--r--recmenuitem.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/recmenuitem.c b/recmenuitem.c
index a58c428..3a0a5ab 100644
--- a/recmenuitem.c
+++ b/recmenuitem.c
@@ -2148,7 +2148,6 @@ cRecMenuItemDayChooser::cRecMenuItemDayChooser(cString text,
this->callback = callback;
this->indent = indent;
height = 3 * font->Height() / 2;
-// height = 2 * font->Height();
selectedDay = 0;
pixmapWeekdays = NULL;
pixmapWeekdaysSelect = NULL;
@@ -2189,13 +2188,13 @@ void cRecMenuItemDayChooser::Show(void) {
void cRecMenuItemDayChooser::SetSizes(void) {
days = trVDR("MTWTFSS");
int maxWidth = 0;
- for (unsigned i=0; i<days.length(); ++i) {
+ for (unsigned i = 0; i < days.length(); ++i) {
int charWidth = font->Width(days.at(i));
if (charWidth > maxWidth)
maxWidth = charWidth;
}
- daysSize = min(maxWidth + 15, height-4);
- daysX = width - 10 - 7*daysSize;
+ daysSize = min(maxWidth + 15, height - 4);
+ daysX = width - 10 - 7 * daysSize;
daysY = (height - daysSize) / 2;
}
@@ -2217,13 +2216,13 @@ void cRecMenuItemDayChooser::Draw(void) {
void cRecMenuItemDayChooser::DrawDays(void) {
pixmapWeekdays->Fill(clrTransparent);
int textY = (height - font->Height()) / 2;
- pixmapWeekdays->DrawRectangle(cRect(daysX, daysY, 7*daysSize, daysSize), theme.Color(clrBorder));
+ pixmapWeekdays->DrawRectangle(cRect(daysX, daysY, 7 * daysSize, daysSize), theme.Color(clrBorder));
int currentX = daysX;
- for (unsigned day=0; day<days.length(); ++day) {
+ for (unsigned day = 0; day < days.length(); ++day) {
cString strDay = cString::sprintf("%c", days.at(day));
- pixmapWeekdays->DrawRectangle(cRect(currentX+2, daysY+2, daysSize-4, daysSize-4), theme.Color(clrBackground));
- tColor colorDay = WeekDaySet(day)?theme.Color(clrRecMenuDayActive)
- :theme.Color(clrRecMenuDayInactive);
+ pixmapWeekdays->DrawRectangle(cRect(currentX + 2, daysY + 2, daysSize - 4, daysSize - 4), theme.Color(clrBackground));
+ tColor colorDay = WeekDaySet(day) ? theme.Color(clrRecMenuDayActive)
+ : theme.Color(clrRecMenuDayInactive);
int textX = currentX + (daysSize - font->Width(*strDay)) / 2;
pixmapWeekdays->DrawText(cPoint(textX, textY), *strDay, colorDay, clrTransparent, font);
currentX += daysSize;
@@ -2233,7 +2232,7 @@ void cRecMenuItemDayChooser::DrawDays(void) {
void cRecMenuItemDayChooser::DrawHighlight(int day) {
pixmapWeekdaysSelect->Fill(clrTransparent);
if (day > -1) {
- int currentX = daysX + day*daysSize;
+ int currentX = daysX + day * daysSize;
pixmapWeekdaysSelect->DrawRectangle(cRect(currentX, daysY, daysSize, daysSize), theme.Color(clrRecMenuDayHighlight));
}
}
@@ -2259,13 +2258,13 @@ eRecMenuState cRecMenuItemDayChooser::ProcessKey(eKeys Key) {
switch (Key & ~k_Repeat) {
case kLeft: {
selectedDay--;
- if (selectedDay<0)
+ if (selectedDay < 0)
selectedDay += 7;
DrawHighlight(selectedDay);
return rmsConsumed;
break; }
case kRight: {
- selectedDay = (selectedDay+1)%7;
+ selectedDay = (selectedDay + 1) % 7;
DrawHighlight(selectedDay);
return rmsConsumed;
break; }