summaryrefslogtreecommitdiff
path: root/src/gui/listbox.cpp
diff options
context:
space:
mode:
authorsniper <sniper@livecd.janhome.net>2009-03-11 15:35:54 +0100
committerJared Adams <jaxad0127@gmail.com>2009-03-12 18:53:16 -0600
commit4260cb92571842c6336537bf0d0c47c4f011ac0f (patch)
tree6c9ce9d69dc6914bb9948b152171d216a801f7c9 /src/gui/listbox.cpp
parentf3796c231d5bcac6850fb9afc8db652361e3fceb (diff)
downloadmana-client-4260cb92571842c6336537bf0d0c47c4f011ac0f.tar.gz
mana-client-4260cb92571842c6336537bf0d0c47c4f011ac0f.tar.bz2
mana-client-4260cb92571842c6336537bf0d0c47c4f011ac0f.tar.xz
mana-client-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/listbox.cpp')
-rw-r--r--src/gui/listbox.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index cd5aa736..23d43066 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -24,8 +24,8 @@
#include <guichan/key.hpp>
#include <guichan/listmodel.hpp>
-#include "color.h"
#include "listbox.h"
+#include "palette.h"
#include "../configuration.h"
@@ -44,13 +44,8 @@ void ListBox::draw(gcn::Graphics *graphics)
if (config.getValue("guialpha", 0.8) != mAlpha)
mAlpha = config.getValue("guialpha", 0.8);
- bool valid;
- const int red = (textColor->getColor('H', valid) >> 16) & 0xFF;
- const int green = (textColor->getColor('H', valid) >> 8) & 0xFF;
- const int blue = textColor->getColor('H', valid) & 0xFF;
- const int alpha = (int)(mAlpha * 255.0f);
-
- graphics->setColor(gcn::Color(red, green, blue, alpha));
+ graphics->setColor(guiPalette->getColor(Palette::HIGHLIGHT,
+ (int)(mAlpha * 255.0f)));
graphics->setFont(getFont());
const int fontHeight = getFont()->getHeight();