summaryrefslogtreecommitdiff
path: root/src/gui/equipmentwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-22 21:16:34 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-22 21:16:34 +0300
commit2d17967845119a77aec6388bb27c47339052704a (patch)
tree965b636cf677ddf93a30e8606405594a79b7f105 /src/gui/equipmentwindow.cpp
parent7bedfccf5982534a9cbcb2c18ca0d37df117bfc8 (diff)
downloadmanaplus-2d17967845119a77aec6388bb27c47339052704a.tar.gz
manaplus-2d17967845119a77aec6388bb27c47339052704a.tar.bz2
manaplus-2d17967845119a77aec6388bb27c47339052704a.tar.xz
manaplus-2d17967845119a77aec6388bb27c47339052704a.zip
Improve draw perfomance.
Add new theme color DROPDOWN_SHADOW.
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r--src/gui/equipmentwindow.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp
index 3284301ec..3abd97c73 100644
--- a/src/gui/equipmentwindow.cpp
+++ b/src/gui/equipmentwindow.cpp
@@ -99,6 +99,9 @@ EquipmentWindow::EquipmentWindow(Equipment *equipment, Being *being,
add(mPlayerBox);
add(mUnequip);
+ mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT);
+ mBorderColor = Theme::getThemeColor(Theme::BORDER);
+ setForegroundColor(Theme::getThemeColor(Theme::TEXT));
}
EquipmentWindow::~EquipmentWindow()
@@ -138,16 +141,15 @@ void EquipmentWindow::draw(gcn::Graphics *graphics)
continue;
if (i == mSelected)
{
- const gcn::Color color = Theme::getThemeColor(Theme::HIGHLIGHT);
-
+ mHighlightColor.a = getGuiAlpha();
// Set color to the highlight color
- g->setColor(gcn::Color(color.r, color.g, color.b, getGuiAlpha()));
+ g->setColor(mHighlightColor);
g->fillRectangle(gcn::Rectangle(box->first,
box->second, BOX_WIDTH, BOX_HEIGHT));
}
// Set color black
- g->setColor(Theme::getThemeColor(Theme::BORDER));
+ g->setColor(mBorderColor);
// Draw box border
g->drawRectangle(gcn::Rectangle(box->first, box->second,
BOX_WIDTH, BOX_HEIGHT));
@@ -167,7 +169,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics)
g->drawImage(image, box->first + 2, box->second + 2);
if (i == EQUIP_PROJECTILE_SLOT)
{
- g->setColor(Theme::getThemeColor(Theme::TEXT));
+ g->setColor(getForegroundColor());
graphics->drawText(toString(item->getQuantity()),
box->first + (BOX_WIDTH / 2),
box->second - fontHeight,