diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-06 00:46:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-06 00:46:56 +0300 |
commit | 478a5fcaa06b001915bd8950c3ef807d73c571ca (patch) | |
tree | 0f55bc740329173537b18a0619769a157a4af82c | |
parent | 592b28ddc60d437b7b7ebd14386873b808605f8e (diff) | |
download | plus-478a5fcaa06b001915bd8950c3ef807d73c571ca.tar.gz plus-478a5fcaa06b001915bd8950c3ef807d73c571ca.tar.bz2 plus-478a5fcaa06b001915bd8950c3ef807d73c571ca.tar.xz plus-478a5fcaa06b001915bd8950c3ef807d73c571ca.zip |
add outline color in textfield class.
-rw-r--r-- | src/gui/theme.cpp | 1 | ||||
-rw-r--r-- | src/gui/theme.h | 1 | ||||
-rw-r--r-- | src/gui/widgets/textfield.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/textfield.h | 1 |
4 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 66d529d85..58d7e8245 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -803,6 +803,7 @@ static int readColorType(const std::string &type) "TAB_SELECTED_OUTLINE", "TEXTBOX", "TEXTFIELD", + "TEXTFIELD_OUTLINE", "WINDOW", "WINDOW_OUTLINE", "PARTY_CHAT_TAB", diff --git a/src/gui/theme.h b/src/gui/theme.h index ef3db572f..ca4204a36 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -243,6 +243,7 @@ class Theme final : public Palette, public ConfigListener TAB_SELECTED_OUTLINE, TEXTBOX, TEXTFIELD, + TEXTFIELD_OUTLINE, WINDOW, WINDOW_OUTLINE, PARTY_CHAT_TAB, diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 23cedfde9..73e01fb63 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -60,6 +60,7 @@ TextField::TextField(const Widget2 *const widget, mLastEventPaste(false), mPadding(1), mCaretColor(&getThemeColor(Theme::CARET)), + mForegroundColor2(getThemeColor(Theme::TEXTFIELD_OUTLINE)), mPopupMenu(nullptr) { setFrameSize(2); @@ -138,7 +139,8 @@ void TextField::draw(gcn::Graphics *graphics) mXScroll); } - graphics->setColor(mForegroundColor); + static_cast<Graphics*>(graphics)->setColorAll( + mForegroundColor, mForegroundColor2); gcn::Font *const font = getFont(); font->drawString(graphics, mText, mPadding - mXScroll, mPadding); BLOCK_END("TextField::draw") diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 14b8f57b5..0c30fc819 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -144,6 +144,7 @@ class TextField : public gcn::TextField, int mLastEventPaste; int mPadding; const gcn::Color *mCaretColor; + gcn::Color mForegroundColor2; PopupMenu *mPopupMenu; }; |