diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-04 20:05:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-04 20:05:48 +0300 |
commit | 62ec17f6e489ec50f17219444468aeb8969dc961 (patch) | |
tree | 350d7edb5c26c282a4e1906544536d68831228ac /src/gui/serverdialog.cpp | |
parent | 71d924d7dcdac067f02a317e9353ee067dbd0bde (diff) | |
parent | fd484fc70fca32ff9065b91c175089b65aa3fd26 (diff) | |
download | mv-62ec17f6e489ec50f17219444468aeb8969dc961.tar.gz mv-62ec17f6e489ec50f17219444468aeb8969dc961.tar.bz2 mv-62ec17f6e489ec50f17219444468aeb8969dc961.tar.xz mv-62ec17f6e489ec50f17219444468aeb8969dc961.zip |
Merge branch 'master' into strippedstripped1.1.9.4
Conflicts:
data/fonts/mplus-1p-bold.ttf
data/fonts/mplus-1p-regular.ttf
src/guichan/basiccontainer.cpp
src/guichan/include/guichan/basiccontainer.hpp
src/guichan/widgets/window.cpp
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r-- | src/gui/serverdialog.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 143d3e5a3..763c190d6 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -158,6 +158,10 @@ public: ServersListBox(ServersListModel *model): ListBox(model) { + mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT); + mTextColor = Theme::getThemeColor(Theme::TEXT); + mNotSupportedColor = Theme::getThemeColor( + Theme::SERVER_VERSION_NOT_SUPPORTED); } void draw(gcn::Graphics *graphics) @@ -169,20 +173,18 @@ public: updateAlpha(); - graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT, - static_cast<int>(mAlpha * 255.0f))); + mHighlightColor.a = static_cast<int>(mAlpha * 255.0f); + graphics->setColor(mHighlightColor); graphics->setFont(getFont()); const int height = getRowHeight(); - const gcn::Color unsupported = - Theme::getThemeColor(Theme::SERVER_VERSION_NOT_SUPPORTED, - static_cast<int>(mAlpha * 255.0f)); + mNotSupportedColor.a = static_cast<int>(mAlpha * 255.0f); // Draw filled rectangle around the selected list element if (mSelected >= 0) { - graphics->fillRectangle(gcn::Rectangle(0, height * mSelected, - getWidth(), height)); + graphics->fillRectangle(gcn::Rectangle(0, + height * mSelected, getWidth(), height)); } // Draw the list elements @@ -191,7 +193,7 @@ public: { ServerInfo info = model->getServer(i); - graphics->setColor(Theme::getThemeColor(Theme::TEXT)); + graphics->setColor(mTextColor); int top; @@ -212,7 +214,7 @@ public: if (info.version.first > 0) { - graphics->setColor(unsupported); + graphics->setColor(mNotSupportedColor); graphics->drawText(info.version.second, getWidth() - info.version.first - 2, top); @@ -224,6 +226,10 @@ public: { return 2 * getFont()->getHeight(); } +private: + gcn::Color mHighlightColor; + gcn::Color mTextColor; + gcn::Color mNotSupportedColor; }; |