summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-19 00:45:35 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-19 00:45:35 +0300
commit1768a3c449f0bb9ac1533781f5134eebe0f9c458 (patch)
treedf57190618f16d260200922c7a6e9cdd42c502aa /src/gui
parentdf866e62698d44dacc423a29a4a127017f1e11f6 (diff)
downloadmv-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.cpp14
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);
}