diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 8f082c969..776b13a5a 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1579,7 +1579,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeader header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_MP3); + CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_MP3); header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index e8d112740..b89218f4c 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() { - CComponentsHeader header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, NULL /*no header icon*/, CComponentsHeader::CC_BTN_MENU); + CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeaderLocalized::CC_BTN_MENU); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 2095ceebb..4c9ccd46c 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -168,7 +168,7 @@ void CBEChannelWidget::paint() void CBEChannelWidget::paintHead() { - CComponentsHeader header(x, y, width, theight, caption.c_str(), NULL /*no header icon*/); + CComponentsHeader header(x, y, width, theight, caption); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index ebebd8f1b..56894699c 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -403,7 +403,7 @@ void CBookmarkManager::hide() //------------------------------------------------------------------------ void CBookmarkManager::paintHead() { - CComponentsHeader header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeader::CC_BTN_HELP); + CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeaderLocalized::CC_BTN_HELP); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 0ee809b31..f8846cdf8 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -590,7 +590,7 @@ void CBouquetList::paintItem(int pos) void CBouquetList::paintHead() { - CComponentsHeader header(x, y, width, theight, name, NULL /*no header icon*/); + CComponentsHeader header(x, y, width, theight, name); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 997e4a25c..91eaa3395 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2118,7 +2118,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) void CChannelList::paintHead() { - CComponentsHeader header(x, y, full_width, theight, name, NULL /*no header icon*/); + CComponentsHeader header(x, y, full_width, theight, name /*no header icon*/); header.paint(CC_SAVE_SCREEN_NO); if (g_Sectionsd->getIsTimeSet()) { diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 8ad8ff113..f03a2f37e 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -17,10 +17,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public - License along with this program; if not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H @@ -38,34 +36,50 @@ using namespace std; CComponentsFooter::CComponentsFooter() { //CComponentsFooter - initVarFooter(); + initVarFooter(1, 1, 0, 0); } -CComponentsFooter::CComponentsFooter( const int x_pos, const int y_pos, const int w, const int h, const int buttons, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow ) +CComponentsFooter::CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h, + const int& buttons, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow ) { //CComponentsFooter - initVarFooter(); + initVarFooter(x_pos, y_pos, w, h, buttons, has_shadow, color_frame, color_body, color_shadow); +} - x = x_pos; - y = y_pos; - width = w; - height = h; +void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h, + const int& buttons, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow ) +{ + cc_item_type = CC_ITEMTYPE_FOOTER; + + x = x_pos; + y = y_pos; + + //init footer width + width = w == 0 ? frameBuffer->getScreenWidth(true) : w; + //init header height + cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; + if (h > 0) + height = h; + else + height = cch_font->getHeight(); + + cch_buttons = buttons; shadow = has_shadow; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - cch_buttons = buttons; + corner_rad = RADIUS_LARGE; + corner_type = CORNER_BOTTOM; initDefaultButtons(); initCCItems(); } - - -void CComponentsFooter::initVarFooter() -{ - cc_item_type = CC_ITEMTYPE_FOOTER; - corner_rad = RADIUS_LARGE; - corner_type = CORNER_BOTTOM; -} diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index d1f14e5fd..89afd950d 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -37,80 +37,79 @@ using namespace std; CComponentsHeader::CComponentsHeader() { //CComponentsHeader - initVarHeader(); + initVarHeader(1, 1, 0, 0, "", "", 0); } -CComponentsHeader::CComponentsHeader( const int x_pos, const int y_pos, const int w, const int h, const std::string& caption, const char* icon_name, const int buttons, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, + const std::string& icon_name, + const int& buttons, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) { - //CComponentsHeader - initVarHeader(); - - x = x_pos; - y = y_pos; - width = w; - if (h > 0) { - userHeight = true; - height = h; - } - shadow = has_shadow; - col_frame = color_frame; - col_body = color_body; - col_shadow = color_shadow; - - cch_text = caption; - cch_icon_name = icon_name; - cch_buttons = buttons; - - initDefaultButtons(); - initCCItems(); + initVarHeader(x_pos, y_pos, w, h, caption, icon_name, buttons, has_shadow, 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 char* icon_name, const int buttons, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) -{ - //CComponentsHeader - initVarHeader(); - - x = x_pos; - y = y_pos; - width = w; - if (h > 0) { - userHeight = true; - height = h; - } - shadow = has_shadow; - col_frame = color_frame; - col_body = color_body; - col_shadow = color_shadow; - - cch_text = g_Locale->getText(caption_locale); - cch_icon_name = icon_name; - cch_buttons = buttons; +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, + bool has_shadow, + 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, + has_shadow, + color_frame, color_body, color_shadow){}; - initDefaultButtons(); - initCCItems(); -} - -void CComponentsHeader::initVarHeader() +void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, + const std::string& icon_name, + const int& buttons, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) { cc_item_type = CC_ITEMTYPE_FRM_HEADER; - col_body = COL_MENUHEAD_PLUS_0; - corner_rad = RADIUS_LARGE, - corner_type = CORNER_TOP; + x = x_pos; + y = y_pos; + + //init header width + width = w == 0 ? frameBuffer->getScreenWidth(true) : w; + //init header height cch_size_mode = CC_HEADER_SIZE_LARGE; cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; - height = cch_font->getHeight(); - userHeight = false; - - //CComponentsHeader + if (h > 0) { + userHeight = true; + height = h; + } + else{ + userHeight = false; + height = cch_font->getHeight(); + } + + shadow = has_shadow; + col_frame = color_frame; + col_body = color_body; + col_shadow = color_shadow; + col_body = COL_MENUHEAD_PLUS_0; + cch_text = caption; + cch_icon_name = icon_name; + cch_buttons = buttons; + + corner_rad = RADIUS_LARGE, + corner_type = CORNER_TOP; + cch_icon_obj = NULL; cch_text_obj = NULL; - cch_icon_name = NULL; cch_btn_obj = NULL; - cch_text = ""; cch_col_text = COL_MENUHEAD_TEXT; cch_caption_align = CTextBox::NO_AUTO_LINEBREAK; cch_items_y = 0; @@ -118,11 +117,12 @@ void CComponentsHeader::initVarHeader() cch_icon_x = cch_offset; cch_icon_w = 0; cch_text_x = cch_offset; - cch_buttons = 0; cch_buttons_w = 0; cch_buttons_h = 0; cch_buttons_space = cch_offset; - v_cch_btn.clear(); + + initDefaultButtons(); + initCCItems(); } CComponentsHeader::~CComponentsHeader() @@ -152,6 +152,16 @@ void CComponentsHeader::setCaptionFont(Font* font_name) } void CComponentsHeader::setIcon(const char* icon_name) +{ + if (icon_name){ + string s_icon = static_cast(icon_name); + setIcon(s_icon); + } + else + setIcon(""); +} + +void CComponentsHeader::setIcon(const std::string& icon_name) { cch_icon_name = icon_name; } @@ -159,18 +169,19 @@ void CComponentsHeader::setIcon(const char* icon_name) void CComponentsHeader::initIcon() { //init cch_icon_obj only if an icon available - if (cch_icon_name == NULL) { + if (cch_icon_name.empty()) { cch_icon_w = 0; - if (cch_icon_obj) + if (cch_icon_obj){ delete cch_icon_obj; - cch_icon_obj = NULL; + cch_icon_obj = NULL; + } return; } //create instance for cch_icon_obj if (cch_icon_obj == NULL){ #ifdef DEBUG_CC - printf(" [CComponentsHeader]\n [%s - %d] init header icon: %s\n", __func__, __LINE__, cch_icon_name); + printf(" [CComponentsHeader]\n [%s - %d] init header icon: %s\n", __func__, __LINE__, cch_icon_name.c_str()); #endif cch_icon_obj = new CComponentsPicture(cch_icon_x, cch_items_y, 0, 0, cch_icon_name); } @@ -179,12 +190,14 @@ void CComponentsHeader::initIcon() if (!cch_icon_obj->isAdded()) addCCItem(cch_icon_obj); //icon - //get dimensions of header icon - int iw, ih; - frameBuffer->getIconSize(cch_icon_name, &iw, &ih); + //set properties for icon object if (cch_icon_obj){ + //get dimensions of header icon + int iw = 0; + int ih = 0; + cch_icon_obj->getPictureSize(&iw, &ih); cch_icon_obj->setWidth(iw); cch_icon_obj->setHeight(ih); cch_icon_obj->doPaintBg(false); @@ -318,7 +331,7 @@ void CComponentsHeader::initCaption() { //recalc header text position if header icon is defined int cc_text_w = 0; - if (cch_icon_name != NULL){ + if (!cch_icon_name.empty()){ cch_text_x = cch_icon_x+cch_icon_w+cch_offset; } diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index d681b57b5..9a422024c 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -30,31 +30,122 @@ #include "cc_item_text.h" #include "cc_frm_icons.h" +//! Sub class of CComponentsForm. Shows a header with prepared items. +/*! +CComponentsHeader provides prepared items like icon, caption and context button icons +*/ class CComponentsHeader : public CComponentsForm { private: - void initVarHeader(); + ///member: init genaral variables, parameters for mostly used properties + void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + const std::string& caption = "header", + const std::string& = "", + const int& buttons = 0, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + protected: + ///object: icon object, see also setIcon() CComponentsPicture * cch_icon_obj; + ///object: caption object, see also setCaption() CComponentsText * cch_text_obj; + ///object: context button object, see also addButtonIcon(), removeButtonIcons() CComponentsIconForm * cch_btn_obj; + + ///property: caption text, see also setCaption() std::string cch_text; - const char* cch_icon_name; + ///property: icon name, see also setIcon() + std::string cch_icon_name; + ///property: caption text color, see also setCaptionColor() fb_pixel_t cch_col_text; + ///property: caption font, see also setCaptionFont() Font* cch_font; - int cch_items_y, cch_icon_x, cch_icon_w, cch_text_x, cch_buttons, cch_buttons_w, cch_buttons_h, cch_buttons_space, cch_offset; + + ///property: internal y-position for all items + int cch_items_y; + ///property: internal x-position for icon object + int cch_icon_x; + ///property: internal width for icon object + int cch_icon_w; + ///property: internal x-position for caption object + int cch_text_x; + ///property: internal context button definition button icons, see modes CC_BTN_HELP, CC_BTN_INFO, CC_BTN_MENU, CC_BTN_EXIT + int cch_buttons; + ///property: internal width for context button object + int cch_buttons_w; + ///property: internal height for context button object + int cch_buttons_h; + ///property: internal offset of context button icons within context button object + int cch_buttons_space; + ///property: internal offset for header items + int cch_offset; + ///property: internal container of icon names for context button object, see also addButtonIcon() std::vector v_cch_btn; + ///property: size of header, possible values are CC_HEADER_SIZE_LARGE, CC_HEADER_SIZE_SMALL int cch_size_mode; + ///property: alignment of caption within header, see also setCaptionAlignment(), possible values are CTextBox::CENTER, default = CTextBox::NO_AUTO_LINEBREAK (left) int cch_caption_align; + bool userHeight; + ///sub: init icon object void initIcon(); + ///sub: init caption object void initCaption(); + ///sub: init context button object void initButtons(); + ///sub: init default buttons for context button object void initDefaultButtons(); + ///sub: init default buttons for context button object void initButtonFormSize(); public: + enum + { + CC_HEADER_ITEM_ICON = 0, + CC_HEADER_ITEM_TEXT = 1, + CC_HEADER_ITEM_BUTTONS = 2 + }; + + CComponentsHeader(); + CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + const std::string& caption = "", + const std::string& = "", + const int& buttons = 0, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + virtual ~CComponentsHeader(); + + ///set caption text, parameters: string, int align_mode (default left) + virtual void setCaption(const std::string& caption, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK); + ///set caption text, parameters: loacle, int align_mode (default left) + virtual void setCaption(neutrino_locale_t caption_locale, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK); + + ///set alignment of caption within header, possible paramters are CTextBox::CENTER, CTextBox::NO_AUTO_LINEBREAK + virtual void setCaptionAlignment(const int& align_mode){cch_caption_align = align_mode;}; + ///set text font object for caption + virtual void setCaptionFont(Font* font_name); + ///set text color for caption + virtual void setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;}; + + ///set offset between items + virtual void setOffset(const int offset){cch_offset = offset;}; + ///set name of icon + virtual void setIcon(const char* icon_name); + ///set name of icon + virtual void setIcon(const std::string& icon_name); + + ///add separate button icons to context button object + virtual void addButtonIcon(const std::string& button_name); + ///remove button icons from context button object + virtual void removeButtonIcons(); + enum { CC_BTN_HELP = 0x02, @@ -63,55 +154,68 @@ class CComponentsHeader : public CComponentsForm CC_BTN_EXIT = 0x80 }; - - enum - { - CC_HEADER_ITEM_ICON = 0, - CC_HEADER_ITEM_TEXT = 1, - CC_HEADER_ITEM_BUTTONS = 2 - }; + ///set internal context button icons, possible modes CC_BTN_HELP, CC_BTN_INFO, CC_BTN_MENU, CC_BTN_EXIT + virtual void setDefaultButtons(const int buttons); + ///set offset between icons within context button object + virtual void setButtonsSpace(const int buttons_space){cch_buttons_space = buttons_space;}; enum { CC_HEADER_SIZE_LARGE = 0, CC_HEADER_SIZE_SMALL = 1 }; - CComponentsHeader(); - CComponentsHeader(const int x_pos, const int y_pos, const int w, const int h = 0, const std::string& caption = "header", const char* icon_name = NULL, const int buttons = 0, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_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 char* icon_name = NULL, const int buttons = 0,bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - virtual ~CComponentsHeader(); - - - virtual void setCaption(const std::string& caption, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK); - virtual void setCaption(neutrino_locale_t caption_locale, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK); - virtual void setCaptionAlignment(const int& align_mode){cch_caption_align = align_mode;}; - virtual void setCaptionFont(Font* font_name); - virtual void setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;}; - virtual void setOffset(const int offset){cch_offset = offset;}; - virtual void setIcon(const char* icon_name); - virtual void addButtonIcon(const std::string& button_name); - virtual void removeButtonIcons(); - virtual void setDefaultButtons(const int buttons); - virtual void setButtonsSpace(const int buttons_space){cch_buttons_space = buttons_space;}; - virtual void initCCItems(); + ///set size of header, possible values are CC_HEADER_SIZE_LARGE, CC_HEADER_SIZE_SMALL virtual void setSizeMode(const int& size_mode){cch_size_mode = size_mode;}; + + ///init all items within header object + virtual void initCCItems(); + ///returns the text object virtual CComponentsText* getTextObject(){return cch_text_obj;}; + + ///paint header virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; +//! Sub class of CComponentsHeader. Shows a header with prepared items. +/*! +CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons +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, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); +}; + +/*! +CComponentsFooter provides prepared container for footer +Is mostly usable like a header but without caption, and context button icons. +*/ class CComponentsFooter : public CComponentsHeader { protected: - void initVarFooter(); + void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + const int& buttons = 0, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); public: CComponentsFooter(); - CComponentsFooter( const int x_pos, const int y_pos, const int w, const int h = 0, - const int buttons = 0, + CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + const int& buttons = 0, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); }; #endif diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 9e899fe7b..dfeaf45d4 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -124,7 +124,7 @@ void EpgPlus::Header::paint(const char * Name) { std::string head = Name ? Name : g_Locale->getText (LOCALE_EPGPLUS_HEAD); - CComponentsHeader header(this->x, this->y, this->width, this->font->getHeight()+4, head, NULL /*no header icon*/); + CComponentsHeader header(this->x, this->y, this->width, this->font->getHeight()+4, head); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 0fb560727..f5d21d53e 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1321,7 +1321,7 @@ void CFileBrowser::paintHead() while ((fnt_title->getRenderWidth(&l_name[i]) > width - 20) && (i < l)) i++; - CComponentsHeader header(x, y, width, theight, &l_name[i], NULL /*no header icon*/); + CComponentsHeader header(x, y, width, theight, &l_name[i]); header.paint(CC_SAVE_SCREEN_NO); free(l_name); diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 954aad025..1eca47b51 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -447,7 +447,7 @@ void CMotorControl::paintStatus() void CMotorControl::paintHead() { - CComponentsHeader header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD, NULL /*no header icon*/); + CComponentsHeaderLocalized 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 99b8ae043..af95d92c4 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -705,7 +705,7 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { - CComponentsHeader header(x, y, width, theight, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_MP3, CComponentsHeader::CC_BTN_HELP); + CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_MP3, CComponentsHeaderLocalized::CC_BTN_HELP); #ifdef ENABLE_GUI_MOUNT header.addButtonIcon(NEUTRINO_ICON_BUTTON_MENU); diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 3855d78fb..450f6219f 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -306,7 +306,7 @@ void CPluginList::paintHead() if (listmaxshow < pluginlist.size()) h_width += 15; - CComponentsHeader header(x, y, h_width, theight, name, NULL /* no header icon */); + CComponentsHeaderLocalized header(x, y, h_width, theight, name); if (pluginlisttype == CPlugins::P_TYPE_GAME) header.setIcon(NEUTRINO_ICON_GAMES); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index f7d9baa9e..f553be1a4 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -326,7 +326,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) g_RCInput->open_click(); } if(!test) { - CComponentsHeader header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED, NULL /*no header icon*/); + CComponentsHeaderLocalized 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 { @@ -490,7 +490,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt) void CScanTs::paint(bool fortest) { - CComponentsHeader header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD, NULL /*no header icon*/); + CComponentsHeaderLocalized header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); header.paint(CC_SAVE_SCREEN_NO); frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 90e530189..9dc613458 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -870,7 +870,7 @@ void CTimerList::paintItem(int pos) void CTimerList::paintHead() { - CComponentsHeader header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER); + CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER); header.setShadowOnOff(CC_SHADOW_ON); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 9486289eb..54a09a72f 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -948,7 +948,7 @@ void CUpnpBrowserGui::paintDevices() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device"); // Head - CComponentsHeader header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); if (CNeutrinoApp::getInstance()->isMuted()) header.addButtonIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL); header.paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 8023ddf53..a86fc473c 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -932,7 +932,7 @@ void CMenuWidget::paint() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8 /*, nameString.c_str()*/); // paint head - CComponentsHeader header(x, y, width + sb_width, hheight, nameString, iconfile.c_str()); + CComponentsHeader header(x, y, width + sb_width, hheight, nameString, iconfile); header.setShadowOnOff(CC_SHADOW_ON); header.setOffset(10); header.paint(CC_SAVE_SCREEN_NO);