From 81ce87bca8dc1076ece1213e5092cf50e3ad9786 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 28 May 2013 01:32:23 +0200 Subject: [PATCH] bouqueteditor: using CComponentsHeader to paint header * move menu button to header Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/920e454274d4cabbf7da91d767516fa856de923a Author: vanhofen Date: 2013-05-28 (Tue, 28 May 2013) Origin message was: ------------------ - bouqueteditor: using CComponentsHeader to paint header * move menu button to header ------------------ This commit was generated by Migit --- src/gui/bedit/bouqueteditor_bouquets.cpp | 28 +++++++++--------------- src/gui/bedit/bouqueteditor_channels.cpp | 5 +++-- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 076fc09b7..56b96a2e0 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -129,34 +130,26 @@ void CBEBouquetWidget::paint() void CBEBouquetWidget::paintHead() { - frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width, g_Locale->getText(LOCALE_BOUQUETLIST_HEAD), COL_MENUHEAD, 0, true); // UTF-8 + CComponentsHeader header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, NULL /*no header icon*/, CComponentsHeader::CC_BTN_MENU); + header.paint(); } -const struct button_label CBEBouquetWidgetButtons[3] = +const struct button_label CBEBouquetWidgetButtons[4] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_BOUQUETEDITOR_DELETE }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_BOUQUETEDITOR_ADD }, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETEDITOR_MOVE } + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETEDITOR_MOVE }, + { NEUTRINO_ICON_BUTTON_BLUE , NONEXISTANT_LOCALE /*dummy*/} }; void CBEBouquetWidget::paintFoot() { - int icol_w, icol_h, h2; - struct button_label Button[5]; + struct button_label Button[4]; Button[0] = CBEBouquetWidgetButtons[0]; Button[1] = CBEBouquetWidgetButtons[1]; Button[2] = CBEBouquetWidgetButtons[2]; - Button[3].button = NEUTRINO_ICON_BUTTON_BLUE; - -/* I have a more elegant solution in buttons.cpp - const neutrino_locale_t button_ids[] = {LOCALE_BOUQUETEDITOR_RENAME,LOCALE_BOUQUETEDITOR_HIDE,LOCALE_BOUQUETEDITOR_LOCK}; - const std::vector buttonID_rest (button_ids, button_ids + sizeof(button_ids) / sizeof(neutrino_locale_t) ); -*/ - - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &icol_w, &h2); + Button[3] = CBEBouquetWidgetButtons[3]; switch( blueFunction) { @@ -170,9 +163,8 @@ void CBEBouquetWidget::paintFoot() Button[3].locale = LOCALE_BOUQUETEDITOR_LOCK; break; } - Button[4].button = NEUTRINO_ICON_BUTTON_MENU; - Button[4].locale = NONEXISTANT_LOCALE; - ::paintButtons(x, y+height, width, 5, Button, width, ButtonHeight); + + ::paintButtons(x, y+height, width, 4, Button, width, ButtonHeight); } void CBEBouquetWidget::hide() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index deee867bb..096835274 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -44,6 +44,7 @@ #include #include #include "bouqueteditor_chanselect.h" +#include #include #include @@ -167,8 +168,8 @@ void CBEChannelWidget::paint() void CBEChannelWidget::paintHead() { - frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width, caption.c_str() , COL_MENUHEAD, 0, true); + CComponentsHeader header(x, y, width, theight, caption.c_str(), NULL /*no header icon*/); + header.paint(); } const struct button_label CBEChannelWidgetButtons[4] =