mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- helpbox: fix icon alignment
This commit is contained in:
@@ -88,17 +88,19 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in
|
|||||||
|
|
||||||
CComponentsPicture *picon = NULL;
|
CComponentsPicture *picon = NULL;
|
||||||
int w_picon = 0;
|
int w_picon = 0;
|
||||||
|
int h_picon = 0;
|
||||||
if (!icon.empty()){
|
if (!icon.empty()){
|
||||||
picon = new CComponentsPicture (0, 0, icon);
|
picon = new CComponentsPicture (0, 0, icon);
|
||||||
w_picon = picon->getHeight();
|
w_picon = picon->getWidth();
|
||||||
|
h_picon = picon->getHeight();
|
||||||
picon->doPaintBg(false);
|
picon->doPaintBg(false);
|
||||||
picon->setYPos(line->getHeight()/2 - w_picon/2);
|
picon->setYPos(line->getHeight()/2 - h_picon/2);
|
||||||
picon->SetTransparent(CFrameBuffer::TM_BLACK);
|
picon->SetTransparent(CFrameBuffer::TM_BLACK);
|
||||||
line->addCCItem(picon);
|
line->addCCItem(picon);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!text.empty()){
|
if (!text.empty()){
|
||||||
int x_text = w_picon + (picon ? 10 : 0);
|
int x_text = w_picon + (picon ? OFFSET_INNER_MID : 0);
|
||||||
CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, line_height, text, text_mode, font);
|
CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, line_height, text, text_mode, font);
|
||||||
#if 0 //"contrast agent", if you want to see where the text items are drawn.
|
#if 0 //"contrast agent", if you want to see where the text items are drawn.
|
||||||
txt->setColorBody(COL_RED);
|
txt->setColorBody(COL_RED);
|
||||||
|
Reference in New Issue
Block a user