summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-05 23:56:48 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-05 23:56:48 +0300
commita2c2444d9eb4b43fb73339ae1cc3b7464f33409e (patch)
tree44ff07e2fed8af0273f899de5dfaf11f0dbf3fb5 /src/gui/widgets
parent2f1650a30d6f3d2f69f09ee1ad3258fc8b0c7e32 (diff)
downloadmanaplus-a2c2444d9eb4b43fb73339ae1cc3b7464f33409e.tar.gz
manaplus-a2c2444d9eb4b43fb73339ae1cc3b7464f33409e.tar.bz2
manaplus-a2c2444d9eb4b43fb73339ae1cc3b7464f33409e.tar.xz
manaplus-a2c2444d9eb4b43fb73339ae1cc3b7464f33409e.zip
add outline color to listbox.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/listbox.cpp8
-rw-r--r--src/gui/widgets/listbox.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index 2e84bb1a2..d2b7eb712 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -45,7 +45,9 @@ ListBox::ListBox(const Widget2 *const widget,
gcn::ListBox(listModel),
Widget2(widget),
mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
+ mForegroundColor2(getThemeColor(Theme::LISTBOX_OUTLINE)),
mForegroundSelectedColor(getThemeColor(Theme::LISTBOX_SELECTED)),
+ mForegroundSelectedColor2(getThemeColor(Theme::LISTBOX_SELECTED_OUTLINE)),
mDistributeMousePressed(true),
mOldSelected(-1),
mPadding(0),
@@ -88,6 +90,7 @@ void ListBox::draw(gcn::Graphics *graphics)
BLOCK_START("ListBox::draw")
updateAlpha();
+ Graphics *const g = static_cast<Graphics*>(graphics);
mHighlightColor.a = static_cast<int>(mAlpha * 255.0f);
graphics->setColor(mHighlightColor);
@@ -105,12 +108,13 @@ void ListBox::draw(gcn::Graphics *graphics)
const int sel = getSelected();
if (sel >= 0)
{
- graphics->setColor(mForegroundSelectedColor);
+ g->setColorAll(mForegroundSelectedColor,
+ mForegroundSelectedColor2);
font->drawString(graphics, mListModel->getElementAt(sel),
mPadding, sel * height + mPadding);
}
// Draw the list elements
- graphics->setColor(mForegroundColor);
+ g->setColorAll(mForegroundColor, mForegroundColor2);
for (int i = 0, y = 0; i < mListModel->getNumberOfElements();
++i, y += height)
{
diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h
index 8296d90e4..ea48c6f16 100644
--- a/src/gui/widgets/listbox.h
+++ b/src/gui/widgets/listbox.h
@@ -91,7 +91,9 @@ class ListBox : public gcn::ListBox,
protected:
gcn::Color mHighlightColor;
+ gcn::Color mForegroundColor2;
gcn::Color mForegroundSelectedColor;
+ gcn::Color mForegroundSelectedColor2;
bool mDistributeMousePressed;
int mOldSelected;
int mPadding;