*menu: hide detail line objects without paintBackgroundBoxRel()

This commit is contained in:
2012-07-16 22:18:49 +02:00
parent 261904acd0
commit 53d4ef64aa
2 changed files with 14 additions and 5 deletions

View File

@@ -35,7 +35,7 @@
#include <driver/screen_max.h>
#include <gui/widget/stringinput.h>
#include <gui/widget/components.h>
#include <global.h>
#include <neutrino.h>
#include <neutrino_menue.h>
@@ -323,6 +323,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg
mglobal = CMenuGlobal::getInstance(); //create CMenuGlobal instance only here
frameBuffer = CFrameBuffer::getInstance();
iconfile = Icon;
details_line = NULL;
//handle select values
if(w_index > MN_WIDGET_ID_MAX){
@@ -391,6 +392,7 @@ CMenuWidget::~CMenuWidget()
page_start.clear();
#endif
resetWidget(true);
delete details_line;
}
void CMenuWidget::addItem(CMenuItem* menuItem, const bool defaultselected)
@@ -1076,8 +1078,9 @@ void CMenuWidget::paintHint(int pos)
int iwidth = width+sb_width;
if (hint_painted) {
/* clear line box */
frameBuffer->paintBackgroundBoxRel(xpos, y+SHADOW_OFFSET, ConnectLineBox_Width, height+hint_height+rad);
/* clear detailsline line */
if (details_line != NULL)
details_line->hide();
/* clear info box */
frameBuffer->paintBackgroundBoxRel(x, ypos2, iwidth+SHADOW_OFFSET, hint_height+SHADOW_OFFSET);
@@ -1102,8 +1105,12 @@ printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText
int ypos2a = ypos2 + (hint_height/2)-2;
int markh = hint_height > rad*2 ? hint_height - rad*2 : hint_height;
int imarkh = iheight/2+1;
CComponentsDetailLine details_line(xpos, ypos1a, ypos2a, imarkh, markh);
details_line.paint();
if (details_line == NULL)
details_line = new CComponentsDetailLine(xpos, ypos1a, ypos2a, imarkh, markh);
else
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);

View File

@@ -41,6 +41,7 @@
#include <system/localize.h>
#include <gui/widget/icons.h>
#include <gui/color.h>
#include <gui/widget/components.h>
#include <string>
#include <vector>
@@ -422,6 +423,7 @@ class CMenuWidget : public CMenuTarget
private:
mn_widget_id_t widget_index;
CMenuGlobal *mglobal;
CComponentsDetailLine *details_line;
protected:
std::string nameString;
neutrino_locale_t name;