From bb895befefd40327b2b38ec9fbdac23aaa3f8095 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 6 Dec 2016 11:16:11 +0100 Subject: [PATCH] CMovieBrowser: add missing context buttons No user can see anything about available submenu and help window, because access to help via submenu is not longer possible since 21ed22cb6e8aab99ec66fefcdeda17659f4a95e9 --- src/gui/moviebrowser/mb.cpp | 25 ++++++++++++++++--------- src/gui/moviebrowser/mb.h | 1 + 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 83ff5f6c0..9650ce603 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -263,6 +263,9 @@ CMovieBrowser::~CMovieBrowser() if (m_movieCover) delete m_movieCover; + + if (m_header) + delete m_header; m_header = NULL; } void CMovieBrowser::clearListLines() @@ -330,6 +333,7 @@ void CMovieBrowser::init(void) m_pcInfo1 = NULL; m_pcInfo2 = NULL; m_pcFilter = NULL; + m_header = NULL; m_windowFocus = MB_FOCUS_BROWSER; m_textTitle = g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD); @@ -1069,10 +1073,11 @@ int CMovieBrowser::exec(const char* path) void CMovieBrowser::hide(void) { //TRACE("[mb]->%s\n", __func__); - if (m_channelLogo) - { - delete m_channelLogo; - m_channelLogo = NULL; + if (m_channelLogo){ + delete m_channelLogo; m_channelLogo = NULL; + } + if (m_header) { + delete m_header; m_header = NULL; } old_EpgId = 0; framebuffer->paintBackground(); @@ -1313,7 +1318,7 @@ void CMovieBrowser::refreshChannelLogo(void) int x = m_cBoxFrame.iX + m_cBoxFrameTitleRel.iX + m_cBoxFrameTitleRel.iWidth - m_channelLogo->getWidth() - OFFSET_INNER_MID; int y = m_cBoxFrame.iY + m_cBoxFrameTitleRel.iY + (m_cBoxFrameTitleRel.iHeight - m_channelLogo->getHeight())/2; - m_channelLogo->setXPos(x - pb_hdd_offset); + m_channelLogo->setXPos(x - pb_hdd_offset - m_header->getContextBtnObject()->getWidth()); m_channelLogo->setYPos(y); m_channelLogo->hide(); m_channelLogo->paint(); @@ -1543,7 +1548,7 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) tmp_blocks_percent_used = blocks_percent_used; const short pbw = 100; const short border = m_cBoxFrameTitleRel.iHeight/4; - CProgressBar pb(m_cBoxFrame.iX+ m_cBoxFrameFootRel.iWidth - pbw - border, m_cBoxFrame.iY+m_cBoxFrameTitleRel.iY + border, pbw, m_cBoxFrameTitleRel.iHeight/2); + CProgressBar pb(m_cBoxFrame.iX+ m_cBoxFrameFootRel.iWidth - m_header->getContextBtnObject()->getWidth() - pbw - border, m_cBoxFrame.iY+m_cBoxFrameTitleRel.iY + border, pbw, m_cBoxFrameTitleRel.iHeight/2); pb.setType(CProgressBar::PB_REDRIGHT); pb.setValues(blocks_percent_used, 100); pb.paint(false); @@ -1830,9 +1835,11 @@ void CMovieBrowser::refreshTitle(void) int w = m_cBoxFrameTitleRel.iWidth; int h = m_cBoxFrameTitleRel.iHeight; - CComponentsHeader header(x, y, w, h, title.c_str(), icon); - header.paint(CC_SAVE_SCREEN_NO); - newHeader = header.isPainted(); + if (!m_header){ + m_header = new CComponentsHeader(x, y, w, h, title.c_str(), icon, CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_MENU); + } + m_header->paint(CC_SAVE_SCREEN_NO); + newHeader = m_header->isPainted(); info_hdd_level(true); } diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index b5f224185..176c34f7f 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -163,6 +163,7 @@ class CMovieBrowser : public CMenuTarget CBox m_cBoxFrameFootRel; CBox m_cBoxFrameTitleRel; + CComponentsHeader *m_header; CComponentsDetailLine *m_detailsLine; CComponentsChannelLogo *m_channelLogo; CComponentsPicture *m_movieCover;