mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
* CComponentsInfoBox: Optimize display
- 'only body paint' can be switched off
This commit is contained in:
@@ -209,7 +209,7 @@ CComponentsInfoBox::CComponentsInfoBox(const int x_pos, const int y_pos, const i
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define INFOBOX_ITEMS_COUNT 3
|
#define INFOBOX_ITEMS_COUNT 3
|
||||||
void CComponentsInfoBox::paint(bool do_save_bg)
|
void CComponentsInfoBox::paint(bool do_save_bg, bool fullPaint)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
rad = RADIUS_LARGE;
|
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},
|
{x+fr_thickness, y+fr_thickness, width-2*fr_thickness, height-2*fr_thickness, col_body, rad, NULL, NULL, false, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int start = (shadow) ? 0 : 1;
|
||||||
if (firstPaint) {
|
if (firstPaint) {
|
||||||
int start = (shadow) ? 0 : 1;
|
|
||||||
if (do_save_bg) {
|
if (do_save_bg) {
|
||||||
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++) {
|
||||||
@@ -231,12 +231,18 @@ void CComponentsInfoBox::paint(bool do_save_bg)
|
|||||||
fbdata[i].pixbuf = NULL;
|
fbdata[i].pixbuf = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// paint infobox full
|
||||||
paintFbItems((comp_fbdata_t*)&fbdata[start], INFOBOX_ITEMS_COUNT - start, false);
|
paintFbItems((comp_fbdata_t*)&fbdata[start], INFOBOX_ITEMS_COUNT - start, false);
|
||||||
firstPaint = false;
|
firstPaint = false;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
// paint body only
|
if (fullPaint)
|
||||||
paintFbItems((comp_fbdata_t*)&fbdata[INFOBOX_ITEMS_COUNT - 1], 1, false);
|
// 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
|
//restore infobox
|
||||||
|
@@ -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,
|
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);
|
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 hide();
|
||||||
void restore(bool clear_);
|
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;};
|
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;};
|
||||||
|
Reference in New Issue
Block a user