mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
ComponentsInfoBox: arange text to the left border if no picture is painted
changed isPainted() to isPicPainted(), return of isPicPainted() value was not marked-down to false and isPainted() means the container frame and isPicPainted() means the picture itself, so the last state was wrong. Now it should work fine. Btw: scope of x_text reduced, is only required in member paintText()
This commit is contained in:
@@ -222,7 +222,7 @@ class CComponentsInfoBox : public CComponentsContainer
|
||||
private:
|
||||
const char* text;
|
||||
int text_mode; //see textbox.h for possible modes
|
||||
int x_text, x_offset;
|
||||
int x_offset;
|
||||
Font* font;
|
||||
CBox * box;
|
||||
CTextBox * textbox;
|
||||
|
@@ -325,7 +325,6 @@ void CComponentsInfoBox::initVarInfobox()
|
||||
textbox = NULL;
|
||||
pic = NULL;
|
||||
pic_name = "";
|
||||
x_text = x;
|
||||
x_offset = 10;
|
||||
|
||||
}
|
||||
@@ -361,8 +360,10 @@ void CComponentsInfoBox::paintText()
|
||||
box = new CBox();
|
||||
|
||||
//define text x position
|
||||
x_text = x+fr_thickness+x_offset;
|
||||
if (pic->isPainted()){
|
||||
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;
|
||||
}
|
||||
@@ -383,7 +384,7 @@ void CComponentsInfoBox::paintText()
|
||||
|
||||
//set properties
|
||||
textbox->setTextFont(font);
|
||||
textbox->movePosition(box->iX, box->iY);
|
||||
textbox->setWindowPos(box);
|
||||
textbox->setTextColor(ibox_col_text);
|
||||
|
||||
//set text
|
||||
@@ -765,6 +766,7 @@ void CComponentsPicture::paint(bool do_save_bg)
|
||||
{
|
||||
initVarPicture();
|
||||
paintInit(do_save_bg);
|
||||
pic_painted = false;
|
||||
|
||||
if (do_paint){
|
||||
if (picMode == CC_PIC_ICON)
|
||||
|
Reference in New Issue
Block a user