mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 17:01:15 +02:00
* CComponentsInfoBox: Optimize display
- Paint full info box only when activating the menu, otherwise only body paint
This commit is contained in:
@@ -204,7 +204,7 @@ CComponentsInfoBox::CComponentsInfoBox(const int x_pos, const int y_pos, const i
|
|||||||
col_body = color_body;
|
col_body = color_body;
|
||||||
col_shadow = color_shadow;
|
col_shadow = color_shadow;
|
||||||
fr_thickness = 2;
|
fr_thickness = 2;
|
||||||
bg_saved = false;
|
firstPaint = true;
|
||||||
v_infobox_val.clear();
|
v_infobox_val.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,20 +221,22 @@ 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},
|
{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;
|
int start = (shadow) ? 0 : 1;
|
||||||
if (do_save_bg) {
|
if (do_save_bg) {
|
||||||
if (!bg_saved) {
|
|
||||||
v_infobox_val.clear();
|
v_infobox_val.clear();
|
||||||
for(int i = start; i < INFOBOX_ITEMS_COUNT; i++) {
|
for(int i = start; i < INFOBOX_ITEMS_COUNT; i++) {
|
||||||
fbdata[i].pixbuf = saveScreen(fbdata[i].x, fbdata[i].y, fbdata[i].dx, fbdata[i].dy);
|
fbdata[i].pixbuf = saveScreen(fbdata[i].x, fbdata[i].y, fbdata[i].dx, fbdata[i].dy);
|
||||||
v_infobox_val.push_back(fbdata[i]);
|
v_infobox_val.push_back(fbdata[i]);
|
||||||
fbdata[i].pixbuf = NULL;
|
fbdata[i].pixbuf = NULL;
|
||||||
}
|
}
|
||||||
bg_saved = true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
paintFbItems((comp_fbdata_t*)&fbdata[start], INFOBOX_ITEMS_COUNT - start, false);
|
paintFbItems((comp_fbdata_t*)&fbdata[start], INFOBOX_ITEMS_COUNT - start, false);
|
||||||
|
firstPaint = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
// paint body only
|
||||||
|
paintFbItems((comp_fbdata_t*)&fbdata[INFOBOX_ITEMS_COUNT - 1], 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//restore infobox
|
//restore infobox
|
||||||
@@ -248,8 +250,10 @@ void CComponentsInfoBox::restore(bool clear_)
|
|||||||
delete[] v_infobox_val[i].pixbuf;
|
delete[] v_infobox_val[i].pixbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (clear_)
|
if (clear_) {
|
||||||
v_infobox_val.clear();
|
v_infobox_val.clear();
|
||||||
|
firstPaint = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@ class CComponentsInfoBox : public CComponents
|
|||||||
int rad,fr_thickness;
|
int rad,fr_thickness;
|
||||||
bool shadow;
|
bool shadow;
|
||||||
fb_pixel_t col_frame, col_body, col_shadow;
|
fb_pixel_t col_frame, col_body, col_shadow;
|
||||||
bool bg_saved;
|
bool firstPaint;
|
||||||
std::vector<comp_fbdata_t> v_infobox_val;
|
std::vector<comp_fbdata_t> v_infobox_val;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user