From 2dfa705d9957a24eb2fe70382795f74325e372f2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 27 Dec 2012 22:23:58 +0300 Subject: Add outlining support to textbox control. --- src/gui/widgets/textbox.cpp | 14 ++++++++++++++ src/gui/widgets/textbox.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index e5e8b50e5..cba575605 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -356,6 +356,7 @@ void TextBox::draw(gcn::Graphics* graphics) } graphics->setColor(mForegroundColor); + static_cast(graphics)->setColor2(mForegroundColor2); gcn::Font *const font = getFont(); const int fontHeight = font->getHeight(); @@ -366,3 +367,16 @@ void TextBox::draw(gcn::Graphics* graphics) } BLOCK_END("TextBox::draw") } + +void TextBox::setForegroundColor(const gcn::Color &color) +{ + mForegroundColor = color; + mForegroundColor2 = color; +} + +void TextBox::setForegroundColorAll(const gcn::Color &color1, + const gcn::Color &color2) +{ + mForegroundColor = color1; + mForegroundColor2 = color2; +} diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h index 5271f742e..8b4ec9f7f 100644 --- a/src/gui/widgets/textbox.h +++ b/src/gui/widgets/textbox.h @@ -62,6 +62,11 @@ class TextBox final : public gcn::TextBox, void draw(gcn::Graphics* graphics); + void setForegroundColor(const gcn::Color &color); + + void setForegroundColorAll(const gcn::Color &color1, + const gcn::Color &color2); + private: int mMinWidth; }; -- cgit v1.2.3-70-g09d2