Merge branch 'dvbsi++' of coolstreamtech.de:cst-public-gui-neutrino into dvbsi++

Origin commit data
------------------
Branch: ni/coolstream
Commit: 4046849a9e
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-07-18 (Wed, 18 Jul 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-07-18 16:01:57 +04:00
5 changed files with 96 additions and 13 deletions

View File

@@ -259,7 +259,7 @@ colormenusetup.menucontent Fensterinhalt
colormenusetup.menucontent_inactive Fensterinhalt deaktiviert colormenusetup.menucontent_inactive Fensterinhalt deaktiviert
colormenusetup.menucontent_selected Fensterinhalt selektiert colormenusetup.menucontent_selected Fensterinhalt selektiert
colormenusetup.menuhead Titelleiste colormenusetup.menuhead Titelleiste
colorstatusbar.text Statusbalken colorstatusbar.text Infobar
colorthememenu.head Theme auswählen colorthememenu.head Theme auswählen
colorthememenu.head2 Themes laden colorthememenu.head2 Themes laden
colorthememenu.name Themename colorthememenu.name Themename

View File

@@ -41,11 +41,15 @@ CComponents::CComponents(const int x_pos, const int y_pos, const int h, const in
height = h; height = h;
width = w; width = w;
frameBuffer = CFrameBuffer::getInstance(); frameBuffer = CFrameBuffer::getInstance();
bg_buf = NULL;
} }
CComponents::~CComponents() CComponents::~CComponents()
{ {
if (bg_buf) {
delete[] bg_buf;
bg_buf = NULL;
}
} }
//------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------
@@ -123,3 +127,51 @@ void CComponentsDetailLine::hide()
col2 = c_tmp2; col2 = c_tmp2;
} }
//-------------------------------------------------------------------------------------------------------
//sub class CComponentsInfoBox
CComponentsInfoBox::CComponentsInfoBox( const int x_pos, const int y_pos, const int width_, const int height_, bool shadow_,
fb_pixel_t color1, fb_pixel_t color2, fb_pixel_t color3)
{
x = x_pos;
y = y_pos;
width = width_;
height = height_;
rad = RADIUS_LARGE;
shadow = shadow_;
bg_saved = false;
col_frame = color1;
col_body = color2;
col_shadow = color3;
bg_buf = new fb_pixel_t[(width+SHADOW_OFFSET) * (height+SHADOW_OFFSET)];
}
void CComponentsInfoBox::paint(int rad_)
{
rad = rad_;
if ((bg_buf != NULL) && (!bg_saved)) {
frameBuffer->SaveScreen(x, y, width+SHADOW_OFFSET, height+SHADOW_OFFSET, bg_buf);
bg_saved = true;
}
/* box shadow */
if (shadow)
frameBuffer->paintBoxRel(x+SHADOW_OFFSET, y+SHADOW_OFFSET, width, height, col_shadow, rad);
/* box frame */
// frameBuffer->paintBoxFrame(x, y, width, height, 2, col_frame, rad);
frameBuffer->paintBoxRel(x, y, width, height, col_frame, rad);
/* box fill */
frameBuffer->paintBoxRel(x+2, y+2, width-4, height-4, col_body, rad);
}
void CComponentsInfoBox::hide(bool full)
{
if (full) {
if (bg_buf != NULL)
frameBuffer->RestoreScreen(x, y, width+SHADOW_OFFSET, height+SHADOW_OFFSET, bg_buf);
else
frameBuffer->paintBackgroundBoxRel(x, y, width+SHADOW_OFFSET, height+SHADOW_OFFSET);
}
else
frameBuffer->paintBoxRel(x+2, y+2, width-4, height-4, col_body, rad);
}

View File

@@ -34,6 +34,7 @@ class CComponents
{ {
protected: protected:
int x, y, height, width; int x, y, height, width;
fb_pixel_t *bg_buf;
CFrameBuffer * frameBuffer; CFrameBuffer * frameBuffer;
@@ -62,6 +63,25 @@ class CComponentsDetailLine : public CComponents
void hide(); void hide();
void setColor(fb_pixel_t color1, fb_pixel_t color2){col1 = color1; col2 = color2;}; void setColor(fb_pixel_t color1, fb_pixel_t color2){col1 = color1; col2 = color2;};
void setYPosDown(const int& y_pos_down){y_down = y_pos_down;}; void setYPosDown(const int& y_pos_down){y_down = y_pos_down;};
void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;};
};
class CComponentsInfoBox : public CComponents
{
private:
int width, height, rad;
fb_pixel_t col_frame, col_body, col_shadow;
bool shadow, bg_saved;
public:
CComponentsInfoBox( const int x_pos, const int y_pos, const int width_, const int height_, bool shadow_ = true,
fb_pixel_t color1 = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color2 = COL_MENUCONTENTDARK_PLUS_0,
fb_pixel_t color3 = COL_MENUCONTENTDARK_PLUS_0);
void paint(int rad_);
void hide(bool full = false);
void setColor(fb_pixel_t color1, fb_pixel_t color2, fb_pixel_t color3){col_frame = color1; col_body = color2; col_shadow = color3;};
}; };
#endif #endif

View File

@@ -325,6 +325,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg
frameBuffer = CFrameBuffer::getInstance(); frameBuffer = CFrameBuffer::getInstance();
iconfile = Icon; iconfile = Icon;
details_line = NULL; details_line = NULL;
info_box = NULL;
//handle select values //handle select values
if(w_index > MN_WIDGET_ID_MAX){ if(w_index > MN_WIDGET_ID_MAX){
@@ -380,6 +381,7 @@ CMenuWidget::~CMenuWidget()
{ {
resetWidget(true); resetWidget(true);
delete details_line; delete details_line;
delete info_box;
} }
void CMenuWidget::addItem(CMenuItem* menuItem, const bool defaultselected) void CMenuWidget::addItem(CMenuItem* menuItem, const bool defaultselected)
@@ -1040,7 +1042,6 @@ void CMenuWidget::paintHint(int pos)
if (pos < 0 && !hint_painted) if (pos < 0 && !hint_painted)
return; return;
fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6;
int rad = RADIUS_LARGE; int rad = RADIUS_LARGE;
int xpos = x - ConnectLineBox_Width; int xpos = x - ConnectLineBox_Width;
@@ -1052,8 +1053,8 @@ void CMenuWidget::paintHint(int pos)
if (details_line != NULL) if (details_line != NULL)
details_line->hide(); details_line->hide();
/* clear info box */ /* clear info box */
frameBuffer->paintBackgroundBoxRel(x, ypos2, iwidth+SHADOW_OFFSET, hint_height+SHADOW_OFFSET); if (info_box != NULL)
info_box->hide((pos == -1) ? true : false);
hint_painted = false; hint_painted = false;
} }
if (pos < 0) if (pos < 0)
@@ -1062,8 +1063,11 @@ void CMenuWidget::paintHint(int pos)
CMenuItem* item = items[pos]; CMenuItem* item = items[pos];
printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText(item->hint)); printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText(item->hint));
if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE) if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE) {
if (info_box != NULL)
info_box->hide(true);
return; return;
}
hint_painted = true; hint_painted = true;
@@ -1078,16 +1082,21 @@ printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText
if (details_line == NULL) if (details_line == NULL)
details_line = new CComponentsDetailLine(xpos, ypos1a, ypos2a, imarkh, markh); details_line = new CComponentsDetailLine(xpos, ypos1a, ypos2a, imarkh, markh);
else else {
details_line->setXPos(xpos);
details_line->setYPos(ypos1a); details_line->setYPos(ypos1a);
details_line->setYPosDown(ypos2a);
details_line->setHMarkDown(markh);
}
details_line->paint(); details_line->paint();
/* box shadow */ if (info_box == NULL)
frameBuffer->paintBoxRel(x+SHADOW_OFFSET, ypos2+SHADOW_OFFSET, width + sb_width, hint_height, COL_MENUCONTENTDARK_PLUS_0, rad); info_box = new CComponentsInfoBox(x, ypos2, iwidth, hint_height);
/* box frame and fill */ else {
frameBuffer->paintBoxFrame(x, ypos2, iwidth, hint_height, 2, col1, rad); info_box->setXPos(x);
/* box frame and fill */ info_box->setYPos(ypos2);
frameBuffer->paintBoxRel(x+2, ypos2+2, iwidth-4, hint_height-4, COL_MENUCONTENTDARK_PLUS_0, rad); }
info_box->paint(rad);
int offset = 10; int offset = 10;
if (!item->hintIcon.empty()) { if (!item->hintIcon.empty()) {

View File

@@ -424,6 +424,8 @@ class CMenuWidget : public CMenuTarget
mn_widget_id_t widget_index; mn_widget_id_t widget_index;
CMenuGlobal *mglobal; CMenuGlobal *mglobal;
CComponentsDetailLine *details_line; CComponentsDetailLine *details_line;
CComponentsInfoBox *info_box;
protected: protected:
std::string nameString; std::string nameString;
neutrino_locale_t name; neutrino_locale_t name;