mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsDetailsLine: add scale to details line width
Also added correction for odd line width values and added method to change details line width.
This commit is contained in:
@@ -61,7 +61,7 @@ void CComponentsDetailsLine::initVarDline( const int& x_pos, const int& y_pos_to
|
|||||||
shadow_w = 1;
|
shadow_w = 1;
|
||||||
|
|
||||||
//CComponentsDetailsLine
|
//CComponentsDetailsLine
|
||||||
thickness = 4; /* MUST be an even value! */
|
dl_w = CFrameBuffer::getInstance()->scale2Res(3);
|
||||||
|
|
||||||
cc_body_gradient_enable = false;
|
cc_body_gradient_enable = false;
|
||||||
}
|
}
|
||||||
@@ -101,6 +101,7 @@ void CComponentsDetailsLine::paint(bool do_save_bg)
|
|||||||
|
|
||||||
int y_mark_top = y-h_mark_top/2;
|
int y_mark_top = y-h_mark_top/2;
|
||||||
int y_mark_down = y_down-h_mark_down/2;
|
int y_mark_down = y_down-h_mark_down/2;
|
||||||
|
int dx_c = dl_w%2; //correction for odd values
|
||||||
|
|
||||||
cc_fbdata_t fbdata[] =
|
cc_fbdata_t fbdata[] =
|
||||||
{
|
{
|
||||||
@@ -108,26 +109,26 @@ void CComponentsDetailsLine::paint(bool do_save_bg)
|
|||||||
{true, CC_FBDATA_TYPE_BGSCREEN, x, y_mark_top, width, y_mark_down-y_mark_top+h_mark_down+sw, 0, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BGSCREEN, x, y_mark_top, width, y_mark_down-y_mark_top+h_mark_down+sw, 0, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
|
|
||||||
/* vertical item mark | */
|
/* vertical item mark | */
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_top, thickness, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_top, dl_w, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_top+sw, sw, h_mark_top-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_top+sw, sw, h_mark_top-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_top+h_mark_top, dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
|
|
||||||
/* horizontal item line - */
|
/* horizontal item line - */
|
||||||
{true, CC_FBDATA_TYPE_BOX, x, y-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x, y-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, width-2*dl_w-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
|
|
||||||
/* vertical connect line [ */
|
/* vertical connect line [ */
|
||||||
{true, CC_FBDATA_TYPE_BOX, x, y+thickness/2, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x, y+dl_w/2+dx_c, dl_w, y_down-y-dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, sw, y_down-y-dl_w, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
|
|
||||||
/* horizontal info line - */
|
/* horizontal info line - */
|
||||||
{true, CC_FBDATA_TYPE_BOX, x, y_down-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x, y_down-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness/2, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+sw, y_down+dl_w/2+dx_c, width-dl_w-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
|
|
||||||
/* vertical info mark | */
|
/* vertical info mark | */
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_down, dl_w, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_down+sw, sw, h_mark_down-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_down+sw, sw, h_mark_down-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
{true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_down+h_mark_down,thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
{true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_down+h_mark_down,dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||||
};
|
};
|
||||||
|
|
||||||
for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++)
|
for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++)
|
||||||
|
@@ -40,8 +40,8 @@ Not usable as CCItem!
|
|||||||
class CComponentsDetailsLine : public CComponents
|
class CComponentsDetailsLine : public CComponents
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
///property: line thickness
|
///property: line width
|
||||||
int thickness;
|
int dl_w;
|
||||||
///property: lowest y position
|
///property: lowest y position
|
||||||
int y_down;
|
int y_down;
|
||||||
///property: height of top marker
|
///property: height of top marker
|
||||||
@@ -73,6 +73,8 @@ class CComponentsDetailsLine : public CComponents
|
|||||||
///set all positions and dimensions of details line at once
|
///set all positions and dimensions of details line at once
|
||||||
void setDimensionsAll(const int& x_pos,const int& y_pos, const int& y_pos_down, const int& h_mark_top_ , const int& h_mark_down_)
|
void setDimensionsAll(const int& x_pos,const int& y_pos, const int& y_pos_down, const int& h_mark_top_ , const int& h_mark_down_)
|
||||||
{setXPos(x_pos); setYPos(y_pos); setYPosDown(y_pos_down); setHMarkTop(h_mark_top_); setHMarkDown(h_mark_down_);}
|
{setXPos(x_pos); setYPos(y_pos); setYPosDown(y_pos_down); setHMarkTop(h_mark_top_); setHMarkDown(h_mark_down_);}
|
||||||
|
///property: set line thickness
|
||||||
|
void setLineWidth(const int& w){dl_w = w;}
|
||||||
|
|
||||||
///paint all to screen
|
///paint all to screen
|
||||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||||
|
Reference in New Issue
Block a user