* CComponentsInfoBox: Optimize display

- 'only body paint' can be switched off
This commit is contained in:
micha-bbg
2012-07-23 07:57:46 +02:00
parent ccd8e39182
commit 0c6ab70c27
2 changed files with 12 additions and 6 deletions

View File

@@ -209,7 +209,7 @@ CComponentsInfoBox::CComponentsInfoBox(const int x_pos, const int y_pos, const i
}
#define INFOBOX_ITEMS_COUNT 3
void CComponentsInfoBox::paint(bool do_save_bg)
void CComponentsInfoBox::paint(bool do_save_bg, bool fullPaint)
{
clear();
rad = RADIUS_LARGE;
@@ -221,8 +221,8 @@ void CComponentsInfoBox::paint(bool do_save_bg)
{x+fr_thickness, y+fr_thickness, width-2*fr_thickness, height-2*fr_thickness, col_body, rad, NULL, NULL, false, 0},
};
if (firstPaint) {
int start = (shadow) ? 0 : 1;
if (firstPaint) {
if (do_save_bg) {
v_infobox_val.clear();
for(int i = start; i < INFOBOX_ITEMS_COUNT; i++) {
@@ -231,13 +231,19 @@ void CComponentsInfoBox::paint(bool do_save_bg)
fbdata[i].pixbuf = NULL;
}
}
// paint infobox full
paintFbItems((comp_fbdata_t*)&fbdata[start], INFOBOX_ITEMS_COUNT - start, false);
firstPaint = false;
}
else {
if (fullPaint)
// paint infobox full
paintFbItems((comp_fbdata_t*)&fbdata[start], INFOBOX_ITEMS_COUNT - start, false);
else
// paint body only
paintFbItems((comp_fbdata_t*)&fbdata[INFOBOX_ITEMS_COUNT - 1], 1, false);
}
}
//restore infobox
void CComponentsInfoBox::restore(bool clear_)

View File

@@ -101,7 +101,7 @@ class CComponentsInfoBox : public CComponents
CComponentsInfoBox( const int x_pos, const int y_pos, const int w, const int h, bool has_shadow = true,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENTDARK_PLUS_0,fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
void paint(bool do_save_bg = true);
void paint(bool do_save_bg = true, bool fullPaint = false);
void hide();
void restore(bool clear_);
void setColor(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow){col_frame = color_frame; col_body = color_body; col_shadow = color_shadow;};