From a1c9ac3b45f556a3dda91fe8f0e50a106f3cd9c3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH] epgplus: use OFFSET defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2371ce0d0145169b2bfd99a9282ce2bec3f91221 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use OFFSET defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 63016dc10..784928c65 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -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(), 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); // paint ticks @@ -174,12 +174,12 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) 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); timeStr = EpgPlus::getTimeString(tickTime, "%M"); 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); 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"); 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); // 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) { - 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); } - 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); } @@ -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->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->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); + this->font->RenderString(this->x + OFFSET_INNER_SMALL, this->y + this->font->getHeight(), + 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 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(), isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); - this->font->RenderString(this->x + 2, this->y + this->font->getHeight(), - this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); + this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(), + this->width - 2*OFFSET_INNER_MID, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); if (isSelected) { @@ -472,7 +472,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s yPos += height; // 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(); @@ -482,7 +482,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s yPos += height; // 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(); @@ -492,7 +492,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s yPos += height; // 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[] =