- epgplus: use OFFSET defines

This commit is contained in:
vanhofen
2017-04-08 14:11:28 +02:00
committed by svenhoefer
parent a026813ad3
commit 2371ce0d01

View File

@@ -157,7 +157,7 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration)
this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(),
toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1);
this->font->RenderString(this->x + 4, this->y + this->font->getHeight(), this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(),
this->width, EpgPlus::getTimeString(_startTime, "%d-%b") , COL_MENUCONTENT_TEXT); this->width, EpgPlus::getTimeString(_startTime, "%d-%b") , COL_MENUCONTENT_TEXT);
// paint ticks // paint ticks
@@ -174,12 +174,12 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration)
int textWidth = this->font->getRenderWidth(timeStr); int textWidth = this->font->getRenderWidth(timeStr);
this->font->RenderString(xPos - textWidth - 4, this->y + this->font->getHeight(), this->font->RenderString(xPos - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight(),
textWidth, timeStr, COL_MENUCONTENT_TEXT); textWidth, timeStr, COL_MENUCONTENT_TEXT);
timeStr = EpgPlus::getTimeString(tickTime, "%M"); timeStr = EpgPlus::getTimeString(tickTime, "%M");
textWidth = this->font->getRenderWidth(timeStr); textWidth = this->font->getRenderWidth(timeStr);
this->font->RenderString(xPos + 4, this->y + this->font->getHeight(), this->font->RenderString(xPos + OFFSET_INNER_MIN, this->y + this->font->getHeight(),
textWidth, timeStr, COL_MENUCONTENT_TEXT); textWidth, timeStr, COL_MENUCONTENT_TEXT);
toggleColor = !toggleColor; toggleColor = !toggleColor;
@@ -212,7 +212,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int
std::string timeStr = EpgPlus::getTimeString(_startTime, "%H:%M"); std::string timeStr = EpgPlus::getTimeString(_startTime, "%H:%M");
int textWidth = this->font->getRenderWidth(timeStr); int textWidth = this->font->getRenderWidth(timeStr);
this->font->RenderString(px - textWidth, this->y + this->font->getHeight() + this->font->getHeight(), this->font->RenderString(px - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(),
textWidth, timeStr, COL_MENUCONTENT_TEXT); textWidth, timeStr, COL_MENUCONTENT_TEXT);
// display end time after mark // display end time after mark
@@ -221,12 +221,12 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int
if (px + pwidth + textWidth < this->x + this->width) if (px + pwidth + textWidth < this->x + this->width)
{ {
this->font->RenderString(px + pwidth, this->y + this->font->getHeight() + this->font->getHeight(), this->font->RenderString(px + pwidth + OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(),
textWidth, timeStr, COL_MENUCONTENT_TEXT); textWidth, timeStr, COL_MENUCONTENT_TEXT);
} }
else if (textWidth < pwidth - 10) else if (textWidth < pwidth - OFFSET_INNER_MID)
{ {
this->font->RenderString(px + pwidth - textWidth, this->y + this->font->getHeight() + this->font->getHeight(), this->font->RenderString(px + pwidth - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(),
textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT); textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT);
} }
@@ -286,8 +286,8 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor)
this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(),
this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2))); this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2)));
this->font->RenderString(this->x + 2, this->y + this->font->getHeight(), this->font->RenderString(this->x + OFFSET_INNER_SMALL, this->y + this->font->getHeight(),
this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); this->width - 2*OFFSET_INNER_SMALL > 0 ? this->width - 2*OFFSET_INNER_MIN : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT);
// paint the separation line // paint the separation line
if (separationLineHeight > 0) if (separationLineHeight > 0)
@@ -369,8 +369,8 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime)
this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(),
isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0);
this->font->RenderString(this->x + 2, this->y + this->font->getHeight(), this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(),
this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); this->width - 2*OFFSET_INNER_MID, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT);
if (isSelected) if (isSelected)
{ {
@@ -472,7 +472,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s
yPos += height; yPos += height;
// display new text // display new text
this->fontBouquetChannelName->RenderString(this->x + 10, yPos, this->width - 20, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUCONTENT_TEXT); this->fontBouquetChannelName->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUCONTENT_TEXT);
height = this->fontEventDescription->getHeight(); height = this->fontEventDescription->getHeight();
@@ -482,7 +482,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s
yPos += height; yPos += height;
// display new text // display new text
this->fontEventDescription->RenderString(this->x + 10, yPos, this->width - 20, description, COL_MENUCONTENT_TEXT); this->fontEventDescription->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, description, COL_MENUCONTENT_TEXT);
height = this->fontEventInfo1->getHeight(); height = this->fontEventInfo1->getHeight();
@@ -492,7 +492,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s
yPos += height; yPos += height;
// display new text // display new text
this->fontEventInfo1->RenderString(this->x + 10, yPos, this->width - 20, info1, COL_MENUCONTENT_TEXT); this->fontEventInfo1->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, info1, COL_MENUCONTENT_TEXT);
} }
struct button_label buttonLabels[] = struct button_label buttonLabels[] =