diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-08-22 21:16:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-08-22 21:16:34 +0300 |
commit | 2d17967845119a77aec6388bb27c47339052704a (patch) | |
tree | 965b636cf677ddf93a30e8606405594a79b7f105 /src/gui/equipmentwindow.cpp | |
parent | 7bedfccf5982534a9cbcb2c18ca0d37df117bfc8 (diff) | |
download | plus-2d17967845119a77aec6388bb27c47339052704a.tar.gz plus-2d17967845119a77aec6388bb27c47339052704a.tar.bz2 plus-2d17967845119a77aec6388bb27c47339052704a.tar.xz plus-2d17967845119a77aec6388bb27c47339052704a.zip |
Improve draw perfomance.
Add new theme color DROPDOWN_SHADOW.
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r-- | src/gui/equipmentwindow.cpp | 12 |
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, |