From fbdde6d2ad8aa6737b59eb18eb0f946384527ec7 Mon Sep 17 00:00:00 2001 From: martii Date: Sun, 9 Jun 2013 10:42:51 +0200 Subject: [PATCH] widget/menue: don't render text over right icon Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6de6baebb461500261854b7677fdf51dc734e73 Author: martii Date: 2013-06-09 (Sun, 09 Jun 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 79a802183..b267ba90e 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -141,7 +141,15 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, } //left text - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y+ item_height, dx- (name_start_x - x), left_text, item_color, 0, true); // UTF-8 + int _dx = dx; + if (!iconName_Info_right.empty()) { + int icon_w = 0; + int icon_h = 0; + CFrameBuffer::getInstance()->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h); + if (icon_w) + _dx -= icon_frame_w + icon_w; + } + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y+ item_height, _dx- (name_start_x - x), left_text, item_color, 0, true); // UTF-8 //right text if (right_text != NULL)