mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
fix right offset when right_text and right_icon is given
This commit is contained in:
@@ -142,9 +142,9 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height,
|
|||||||
|
|
||||||
//left text
|
//left text
|
||||||
int _dx = dx;
|
int _dx = dx;
|
||||||
if (!iconName_Info_right.empty()) {
|
|
||||||
int icon_w = 0;
|
int icon_w = 0;
|
||||||
int icon_h = 0;
|
int icon_h = 0;
|
||||||
|
if (!iconName_Info_right.empty()) {
|
||||||
CFrameBuffer::getInstance()->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h);
|
CFrameBuffer::getInstance()->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h);
|
||||||
if (icon_w)
|
if (icon_w)
|
||||||
_dx -= icon_frame_w + icon_w;
|
_dx -= icon_frame_w + icon_w;
|
||||||
@@ -166,10 +166,12 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height,
|
|||||||
col.setCorner(RADIUS_LARGE);
|
col.setCorner(RADIUS_LARGE);
|
||||||
col.paint(false);
|
col.paint(false);
|
||||||
}
|
}
|
||||||
if (right_text)
|
if (right_text) {
|
||||||
|
stringstartposOption -= (icon_w == 0 ? 0 : icon_w + icon_frame_w);
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height,dx- (stringstartposOption- x), right_text, item_color, 0, true);
|
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height,dx- (stringstartposOption- x), right_text, item_color, 0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CMenuItem::prepareItem(const bool select_mode, const int &item_height)
|
void CMenuItem::prepareItem(const bool select_mode, const int &item_height)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user