bouqueteditor: using CComponentsHeader to paint header

* move menu button to header


Origin commit data
------------------
Branch: ni/coolstream
Commit: 920e454274
Author: vanhofen <vanhofen@gmx.de>
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
This commit is contained in:
vanhofen
2013-05-28 01:32:23 +02:00
parent 2fc06ceead
commit 81ce87bca8
2 changed files with 13 additions and 20 deletions

View File

@@ -40,6 +40,7 @@
#include <driver/fontrenderer.h> #include <driver/fontrenderer.h>
#include <driver/screen_max.h> #include <driver/screen_max.h>
#include <gui/components/cc_frm.h>
#include <gui/widget/buttons.h> #include <gui/widget/buttons.h>
#include <gui/widget/hintbox.h> #include <gui/widget/hintbox.h>
#include <gui/widget/messagebox.h> #include <gui/widget/messagebox.h>
@@ -129,34 +130,26 @@ void CBEBouquetWidget::paint()
void CBEBouquetWidget::paintHead() void CBEBouquetWidget::paintHead()
{ {
frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); CComponentsHeader header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, NULL /*no header icon*/, CComponentsHeader::CC_BTN_MENU);
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 header.paint();
} }
const struct button_label CBEBouquetWidgetButtons[3] = const struct button_label CBEBouquetWidgetButtons[4] =
{ {
{ NEUTRINO_ICON_BUTTON_RED , LOCALE_BOUQUETEDITOR_DELETE }, { NEUTRINO_ICON_BUTTON_RED , LOCALE_BOUQUETEDITOR_DELETE },
{ NEUTRINO_ICON_BUTTON_GREEN , LOCALE_BOUQUETEDITOR_ADD }, { 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() void CBEBouquetWidget::paintFoot()
{ {
int icol_w, icol_h, h2; struct button_label Button[4];
struct button_label Button[5];
Button[0] = CBEBouquetWidgetButtons[0]; Button[0] = CBEBouquetWidgetButtons[0];
Button[1] = CBEBouquetWidgetButtons[1]; Button[1] = CBEBouquetWidgetButtons[1];
Button[2] = CBEBouquetWidgetButtons[2]; Button[2] = CBEBouquetWidgetButtons[2];
Button[3].button = NEUTRINO_ICON_BUTTON_BLUE; Button[3] = CBEBouquetWidgetButtons[3];
/* 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<neutrino_locale_t> 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);
switch( blueFunction) switch( blueFunction)
{ {
@@ -170,9 +163,8 @@ void CBEBouquetWidget::paintFoot()
Button[3].locale = LOCALE_BOUQUETEDITOR_LOCK; Button[3].locale = LOCALE_BOUQUETEDITOR_LOCK;
break; break;
} }
Button[4].button = NEUTRINO_ICON_BUTTON_MENU;
Button[4].locale = NONEXISTANT_LOCALE; ::paintButtons(x, y+height, width, 4, Button, width, ButtonHeight);
::paintButtons(x, y+height, width, 5, Button, width, ButtonHeight);
} }
void CBEBouquetWidget::hide() void CBEBouquetWidget::hide()

View File

@@ -44,6 +44,7 @@
#include <driver/fontrenderer.h> #include <driver/fontrenderer.h>
#include <driver/screen_max.h> #include <driver/screen_max.h>
#include "bouqueteditor_chanselect.h" #include "bouqueteditor_chanselect.h"
#include <gui/components/cc_frm.h>
#include <gui/widget/buttons.h> #include <gui/widget/buttons.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
@@ -167,8 +168,8 @@ void CBEChannelWidget::paint()
void CBEChannelWidget::paintHead() void CBEChannelWidget::paintHead()
{ {
frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); CComponentsHeader header(x, y, width, theight, caption.c_str(), NULL /*no header icon*/);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width, caption.c_str() , COL_MENUHEAD, 0, true); header.paint();
} }
const struct button_label CBEChannelWidgetButtons[4] = const struct button_label CBEChannelWidgetButtons[4] =