From d403f7fc36a66dec857a76c958cc7dbb5e07171a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 16:07:25 +0200 Subject: [PATCH] epgplus: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e89096c4ec22558deb940f5096734e81c8225f3 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - epgplus: add shadow to gui-elements Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index b5d209dd3..1c4107a65 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -114,6 +114,8 @@ void EpgPlus::Header::paint(const char * Name) this->head = new CComponentsHeader(); this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); this->head->enableClock(true, "%H:%M", "%H %M", true); + this->head->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); + } if (this->head) @@ -220,6 +222,9 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) toggleColor = !toggleColor; } + + // shadow + this->frameBuffer->paintBoxRel(this->x + this->width, this->y + OFFSET_SHADOW, OFFSET_SHADOW, this->getUsedHeight(), COL_SHADOW_PLUS_0); } void EpgPlus::TimeLine::paintGrid() @@ -560,7 +565,7 @@ EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, this->width = pwidth; this->buttonHeight = pbuttonHeight; - this->buttonY = this->y - OFFSET_INTER - this->buttonHeight; + this->buttonY = this->y - OFFSET_INTER - OFFSET_SHADOW - this->buttonHeight; } EpgPlus::Footer::~Footer() @@ -591,6 +596,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s int frame_thickness = 2; // clear the whole footer + this->frameBuffer->paintBoxRel(this->x + OFFSET_SHADOW, yPos + OFFSET_SHADOW, this->width, this->getUsedHeight(), COL_SHADOW_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxRel(this->x, yPos, this->width, this->getUsedHeight(), COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxFrame(this->x, yPos, this->width, this->getUsedHeight(), frame_thickness, COL_FRAME_PLUS_0, RADIUS_LARGE); @@ -619,8 +625,9 @@ struct button_label buttonLabels[] = void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons) { int buttonWidth = (this->width); - CComponentsFooter _footer; - _footer.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); + CComponentsFooter foot; + foot.enableShadow(CC_SHADOW_ON, -1, true); + foot.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); } EpgPlus::EpgPlus() @@ -828,10 +835,10 @@ void EpgPlus::init() int footerHeight = Footer::getUsedHeight(); - this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_INTER - footerHeight) / this->entryHeight; + this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_SHADOW - OFFSET_INTER - footerHeight - OFFSET_SHADOW) / this->entryHeight; this->bodyHeight = this->maxNumberOfDisplayableEntries * entryHeight; - this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_INTER + footerHeight; // recalc deltaY + this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_SHADOW + OFFSET_INTER + footerHeight + OFFSET_SHADOW; // recalc deltaY this->usableScreenX = getScreenStartX(this->usableScreenWidth); if (this->usableScreenX < DETAILSLINE_WIDTH) this->usableScreenX = DETAILSLINE_WIDTH; @@ -846,7 +853,7 @@ void EpgPlus::init() this->timeLineWidth = this->usableScreenWidth; this->footerX = usableScreenX; - this->footerY = this->usableScreenY + this->usableScreenHeight - footerHeight; + this->footerY = this->usableScreenY + this->usableScreenHeight - OFFSET_SHADOW - footerHeight; this->footerWidth = this->usableScreenWidth; this->channelsTableX = this->usableScreenX; @@ -1386,7 +1393,7 @@ void EpgPlus::hide() delete this->header->head; this->header->head = NULL; } - this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX - DETAILSLINE_WIDTH, this->usableScreenY, DETAILSLINE_WIDTH + this->usableScreenWidth, this->usableScreenHeight); + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth + OFFSET_SHADOW, this->usableScreenHeight + OFFSET_SHADOW); } void EpgPlus::paintChannelEntry(int position) @@ -1436,7 +1443,7 @@ void EpgPlus::paint() this->maxNumberOfDisplayableEntries, this->selectedChannelEntry == NULL ? 0 : this->selectedChannelEntry->index); - paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page); + paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_ON); } // -- EPG+ Menue Handler Class