diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-19 00:45:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-19 00:45:35 +0300 |
commit | 1768a3c449f0bb9ac1533781f5134eebe0f9c458 (patch) | |
tree | df57190618f16d260200922c7a6e9cdd42c502aa /src/gui | |
parent | df866e62698d44dacc423a29a4a127017f1e11f6 (diff) | |
download | mv-1768a3c449f0bb9ac1533781f5134eebe0f9c458.tar.gz mv-1768a3c449f0bb9ac1533781f5134eebe0f9c458.tar.bz2 mv-1768a3c449f0bb9ac1533781f5134eebe0f9c458.tar.xz mv-1768a3c449f0bb9ac1533781f5134eebe0f9c458.zip |
Fix hightlight selected shop item.v1.2.8.19
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/shoplistbox.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index c7a3bdb1e..7dcd38a88 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -102,7 +102,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) i < mListModel->getNumberOfElements(); ++i, y += mRowHeight) { -/* + bool needDraw(false); gcn::Color temp; gcn::Color* backgroundColor = &mBackgroundColor; mBackgroundColor.a = alpha; @@ -124,15 +124,20 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) temp.a = alpha; backgroundColor = &temp; } + needDraw = true; } else if (i == mSelected) { backgroundColor = &mHighlightColor; + needDraw = true; + } + + if (needDraw) + { + graphics->setColor(*backgroundColor); + graphics->fillRectangle(gcn::Rectangle(0, y, getWidth(), mRowHeight)); } -// graphics->setColor(*backgroundColor); -// graphics->fillRectangle(gcn::Rectangle(0, y, getWidth(), mRowHeight)); -*/ if (mShopItems) { Image *icon = mShopItems->at(i)->getImage(); @@ -142,6 +147,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) graphics->drawImage(icon, 1, y); } } + graphics->setColor(getForegroundColor()); graphics->drawText(mListModel->getElementAt(i), ITEM_ICON_SIZE + 5, y + (ITEM_ICON_SIZE - getFont()->getHeight()) / 2); } |