mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsInfoBox: move define of x_text onto paint()
This commit is contained in:
@@ -248,7 +248,7 @@ class CComponentsInfoBox : public CComponentsItem
|
|||||||
private:
|
private:
|
||||||
const char* text;
|
const char* text;
|
||||||
int text_mode; //see textbox.h for possible modes
|
int text_mode; //see textbox.h for possible modes
|
||||||
int x_offset;
|
int x_text, x_offset;
|
||||||
Font* font;
|
Font* font;
|
||||||
CBox * box;
|
CBox * box;
|
||||||
CTextBox * textbox;
|
CTextBox * textbox;
|
||||||
@@ -277,9 +277,9 @@ class CComponentsInfoBox : public CComponentsItem
|
|||||||
inline void setTextColor(fb_pixel_t color_text){ ibox_col_text = color_text;};
|
inline void setTextColor(fb_pixel_t color_text){ ibox_col_text = color_text;};
|
||||||
inline void setSpaceOffset(const int offset){x_offset = offset;};
|
inline void setSpaceOffset(const int offset){x_offset = offset;};
|
||||||
inline void setPicture(const std::string& picture_name){pic_name = picture_name;};
|
inline void setPicture(const std::string& picture_name){pic_name = picture_name;};
|
||||||
void removeLineBreaks(std::string& str);
|
|
||||||
|
|
||||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||||
|
void removeLineBreaks(std::string& str);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -347,7 +347,6 @@ void CComponentsText::hide(bool no_restore)
|
|||||||
hideContainer(no_restore);
|
hideContainer(no_restore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------
|
||||||
//sub class CComponentsInfoBox from CComponentsItem
|
//sub class CComponentsInfoBox from CComponentsItem
|
||||||
CComponentsInfoBox::CComponentsInfoBox()
|
CComponentsInfoBox::CComponentsInfoBox()
|
||||||
@@ -409,6 +408,7 @@ void CComponentsInfoBox::initVarInfobox()
|
|||||||
pic = NULL;
|
pic = NULL;
|
||||||
pic_name = "";
|
pic_name = "";
|
||||||
x_offset = 10;
|
x_offset = 10;
|
||||||
|
x_text = x+fr_thickness+x_offset;;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,15 +442,6 @@ void CComponentsInfoBox::paintText()
|
|||||||
if (box == NULL)
|
if (box == NULL)
|
||||||
box = new CBox();
|
box = new CBox();
|
||||||
|
|
||||||
//define text x position
|
|
||||||
int x_text = x+fr_thickness+x_offset;
|
|
||||||
|
|
||||||
//set text to the left border if picture not painted
|
|
||||||
if (pic->isPicPainted()){
|
|
||||||
int pic_w = pic->getWidth();
|
|
||||||
x_text += pic_w+x_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
box->iX = x_text;
|
box->iX = x_text;
|
||||||
box->iY = y+fr_thickness;
|
box->iY = y+fr_thickness;
|
||||||
|
|
||||||
@@ -480,6 +471,16 @@ void CComponentsInfoBox::paint(bool do_save_bg)
|
|||||||
{
|
{
|
||||||
paintInit(do_save_bg);
|
paintInit(do_save_bg);
|
||||||
paintPicture();
|
paintPicture();
|
||||||
|
|
||||||
|
//define text x position
|
||||||
|
x_text = x+fr_thickness+x_offset;
|
||||||
|
|
||||||
|
//set text to the left border if picture is not painted
|
||||||
|
if (pic->isPicPainted()){
|
||||||
|
int pic_w = pic->getWidth();
|
||||||
|
x_text += pic_w+x_offset;
|
||||||
|
}
|
||||||
|
|
||||||
if (text)
|
if (text)
|
||||||
paintText();
|
paintText();
|
||||||
text = NULL;
|
text = NULL;
|
||||||
@@ -495,6 +496,8 @@ void CComponentsInfoBox::removeLineBreaks(std::string& str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------
|
||||||
//sub class CComponentsShapeSquare from CComponentsItem
|
//sub class CComponentsShapeSquare from CComponentsItem
|
||||||
CComponentsShapeSquare::CComponentsShapeSquare(const int x_pos, const int y_pos, const int w, const int h, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
CComponentsShapeSquare::CComponentsShapeSquare(const int x_pos, const int y_pos, const int w, const int h, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||||
|
Reference in New Issue
Block a user