diff options
author | sniper <sniper@livecd.janhome.net> | 2009-03-11 15:35:54 +0100 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-03-12 18:53:16 -0600 |
commit | 4260cb92571842c6336537bf0d0c47c4f011ac0f (patch) | |
tree | 6c9ce9d69dc6914bb9948b152171d216a801f7c9 /src/gui/widgets/dropdown.cpp | |
parent | f3796c231d5bcac6850fb9afc8db652361e3fceb (diff) | |
download | mana-4260cb92571842c6336537bf0d0c47c4f011ac0f.tar.gz mana-4260cb92571842c6336537bf0d0c47c4f011ac0f.tar.bz2 mana-4260cb92571842c6336537bf0d0c47c4f011ac0f.tar.xz mana-4260cb92571842c6336537bf0d0c47c4f011ac0f.zip |
Extending the internal handling of colors
The internal storage for colors was in the file color.h/color.cpp. It
mainly managed the colors in the chat.
The Color class was extended to be more generic now and it stores
gcn::Color objects instead of integers now. A lot of new colortypes are
now available, though not many of them are used for now, that will come
in the next patches.
The Color class was renamed to Palette and color.{h,cpp} to
palette.{h,cpp} to better describe its purpose.
The color config gui now lists the new colors, even changes them, but the
result is not displayed properly for now.
Diffstat (limited to 'src/gui/widgets/dropdown.cpp')
-rw-r--r-- | src/gui/widgets/dropdown.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index c91a8524..022da0f0 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -23,8 +23,8 @@ #include "dropdown.h" -#include "../color.h" #include "../listbox.h" +#include "../palette.h" #include "../scrollarea.h" #include "../../configuration.h" @@ -139,27 +139,24 @@ void DropDown::draw(gcn::Graphics* graphics) } } - bool valid; +// bool valid; const int alpha = (int)(mAlpha * 255.0f); gcn::Color faceColor = getBaseColor(); faceColor.a = alpha; - gcn::Color highlightColor = textColor->getColor('H', valid); - highlightColor.a = alpha; + gcn::Color highlightColor = guiPalette->getColor(Palette::HIGHLIGHT, alpha); gcn::Color shadowColor = faceColor - 0x303030; shadowColor.a = alpha; if (mOpaque) { - int red = getBackgroundColor().r; - int green = getBackgroundColor().g; - int blue = getBackgroundColor().b; - graphics->setColor(gcn::Color(red, green, blue, alpha)); + gcn::Color col = getBackgroundColor(); + col.a = alpha; + graphics->setColor(col); graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), h)); - red = getForegroundColor().r; - green = getForegroundColor().g; - blue = getForegroundColor().b; - graphics->setColor(gcn::Color(red, green, blue, alpha)); + col = getForegroundColor(); + col.a = alpha; + graphics->setColor(col); } graphics->setFont(getFont()); |