diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index f3ff5f8b6..91d0a3085 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1602,7 +1602,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeader header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.setCorner(RADIUS_MID, CORNER_TOP); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index fc2eb5994..6c8486bc0 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -133,7 +133,7 @@ void CBEBouquetWidget::paint() void CBEBouquetWidget::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeaderLocalized::CC_BTN_EXIT); + CComponentsHeader header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeader::CC_BTN_EXIT); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index f91b47469..383ee2555 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -411,7 +411,7 @@ void CBookmarkManager::hide() //------------------------------------------------------------------------ void CBookmarkManager::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeader header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeader::CC_BTN_HELP); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 7a91fd8c5..a74875e72 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -65,21 +65,18 @@ CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const initVarHeader(x_pos, y_pos, w, h, caption, icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); } -CComponentsHeaderLocalized::CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h, - neutrino_locale_t caption_locale, - const std::string& icon_name, - const int& buttons, - CComponentsForm* parent, - int shadow_mode, - fb_pixel_t color_frame, - fb_pixel_t color_body, - fb_pixel_t color_shadow) - :CComponentsHeader( x_pos, y_pos, w, h, - g_Locale->getText(caption_locale), - icon_name, buttons, - parent, - shadow_mode, - color_frame, color_body, color_shadow){}; +CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t caption_locale, + const std::string& icon_name, + const int& buttons, + CComponentsForm* parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) +{ + initVarHeader(x_pos, y_pos, w, h, g_Locale->getText(caption_locale), icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); +}; void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index e1dd05f66..1d634c3cd 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -170,7 +170,17 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsHeader(CComponentsForm *parent = NULL); CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, const std::string& caption = std::string(), - const std::string& = std::string(), + const std::string& icon_name = std::string(), + const int& buttons = 0, + CComponentsForm *parent = NULL, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + + CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, + const std::string& icon_name = std::string(), const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, @@ -346,23 +356,4 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsChannelLogoScalable* getChannelLogoObject(){return cch_logo_obj;} }; -//! Sub class of CComponentsHeader. -/*! -CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows -Caption is defined with locales. -*/ -class CComponentsHeaderLocalized : public CComponentsHeader -{ - public: - CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, - const std::string& = "", - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); -}; - #endif diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index b696c54ea..f2d5d4adb 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -841,14 +841,15 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // show the epg // header + logo - if (!header){ - header = new CComponentsHeader(sx, sy, ox, toph); + if (!header) + { + header = new CComponentsHeader(); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->enableClock(true, "%H:%M", "%H %M", true); - }else - header->setDimensionsAll(sx, sy, ox, toph); + } + header->setDimensionsAll(sx, sy, ox, toph); header->setCaptionFont(font_title); header->setCaption(epgData.title); diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 67adbf805..1b9e38e36 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -455,7 +455,7 @@ void CMotorControl::paintStatus() void CMotorControl::paintHead() { - CComponentsHeaderLocalized header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); + CComponentsHeader header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 9ccb9952f..a7f19f1ef 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -701,7 +701,7 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { - CComponentsHeaderLocalized header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeader header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeader::CC_BTN_HELP); header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); #ifdef ENABLE_GUI_MOUNT diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 1709db61e..358cbd8bf 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -345,7 +345,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); } if(!test) { - CComponentsHeaderLocalized header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); + CComponentsHeader header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); header.paint(CC_SAVE_SCREEN_NO); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(0xFFFF); do { @@ -506,7 +506,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt) void CScanTs::paint(bool fortest) { - CComponentsHeaderLocalized header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); + CComponentsHeader header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); header.setCaptionAlignment(CCHeaderTypes::CC_TITLE_CENTER); header.paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ca48a92f6..5fe4586b3 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1380,7 +1380,7 @@ void CTimerList::paintHead() { if (header == NULL) { - header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(LOCALE_TIMERLIST_NAME), NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); + header = new CComponentsHeader(x, y, width, header_height, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); header->enableClock(true, " %d.%m.%Y - %H:%M ", NULL, false); } header->paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index b8c3d5878..dbfcf8aa7 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -986,7 +986,7 @@ void CUpnpBrowserGui::paintDevices() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device"); // Head - CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + CComponentsHeader header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL);