* Use CComponentsInfoBox for menu hint

This commit is contained in:
micha-bbg
2012-07-17 16:51:00 +02:00
parent 5c862f76a9
commit fd1ec29d83
2 changed files with 17 additions and 10 deletions

View File

@@ -324,6 +324,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg
frameBuffer = CFrameBuffer::getInstance();
iconfile = Icon;
details_line = NULL;
info_box = NULL;
//handle select values
if(w_index > MN_WIDGET_ID_MAX){
@@ -393,6 +394,7 @@ CMenuWidget::~CMenuWidget()
#endif
resetWidget(true);
delete details_line;
delete info_box;
}
void CMenuWidget::addItem(CMenuItem* menuItem, const bool defaultselected)
@@ -1071,7 +1073,6 @@ void CMenuWidget::paintHint(int pos)
if (pos < 0 && !hint_painted)
return;
fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6;
int rad = RADIUS_LARGE;
int xpos = x - ConnectLineBox_Width;
@@ -1083,8 +1084,8 @@ void CMenuWidget::paintHint(int pos)
if (details_line != NULL)
details_line->hide();
/* 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;
}
if (pos < 0)
@@ -1093,8 +1094,11 @@ void CMenuWidget::paintHint(int pos)
CMenuItem* item = items[pos];
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;
}
hint_painted = true;
@@ -1113,12 +1117,13 @@ printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText
details_line->setYPos(ypos1a);
details_line->paint();
/* box shadow */
frameBuffer->paintBoxRel(x+SHADOW_OFFSET, ypos2+SHADOW_OFFSET, width + sb_width, hint_height, COL_MENUCONTENTDARK_PLUS_0, rad);
/* box frame and fill */
frameBuffer->paintBoxFrame(x, ypos2, iwidth, hint_height, 2, col1, rad);
/* box frame and fill */
frameBuffer->paintBoxRel(x+2, ypos2+2, iwidth-4, hint_height-4, COL_MENUCONTENTDARK_PLUS_0, rad);
if (info_box == NULL)
info_box = new CComponentsInfoBox(x, ypos2, iwidth, hint_height, rad);
else {
info_box->setXPos(x);
info_box->setYPos(ypos2);
}
info_box->paint(rad);
int offset = 10;
if (!item->hintIcon.empty()) {