From c8a7e2e6a8518f0569ee79ec7f6cdd013b79c762 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 29 Apr 2013 21:08:44 +0200 Subject: [PATCH] src/gui/widget/menue.cpp: don't paint icon if no space for this Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6f552797b473d35929dc579d0a23cca9032ab6b5 Author: Jacek Jendrzej Date: 2013-04-29 (Mon, 29 Apr 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 230680296..c4e1477b1 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -190,9 +190,6 @@ void CMenuItem::paintItemButton(const bool select_mode, const int &item_height, bool selected = select_mode; bool icon_painted = false; - int w = 0; - int h = 0; - std::string icon_name = iconName; int icon_w = 0; int icon_h = 0; @@ -223,11 +220,9 @@ void CMenuItem::paintItemButton(const bool select_mode, const int &item_height, //get data of number icon and paint if (!icon_name.empty()) { - frameBuffer->getIconSize(icon_name.c_str(), &w, &h); - icon_w = w; - icon_h = h; - - if (active && icon_w>0 && icon_h>0) + frameBuffer->getIconSize(icon_name.c_str(), &icon_w, &icon_h); + + if (active && icon_w>0 && icon_h>0 && icon_space_x >= icon_w) { icon_x = icon_space_mid - (icon_w/2); @@ -248,9 +243,7 @@ void CMenuItem::paintItemButton(const bool select_mode, const int &item_height, //get data of number right info icon and paint if (!iconName_Info_right.empty()) { - frameBuffer->getIconSize(iconName_Info_right.c_str(), &w, &h); - icon_w = w; - icon_h = h; + frameBuffer->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h); if (active && icon_w>0 && icon_h>0) {