From 0ea8c99f68bf6af25776914af324cb1c7632bc54 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 6 May 2013 01:08:57 +0300 Subject: add outline color in checbox class. --- src/gui/theme.cpp | 1 + src/gui/theme.h | 1 + src/gui/widgets/checkbox.cpp | 4 +++- src/gui/widgets/checkbox.h | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index e4f78efd2..0babc9dbb 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -789,6 +789,7 @@ static int readColorType(const std::string &type) "BUTTON_PRESSED", "BUTTON_PRESSED_OUTLINE", "CHECKBOX", + "CHECKBOX_OUTLINE", "DROPDOWN", "LABEL", "LABEL_OUTLINE", diff --git a/src/gui/theme.h b/src/gui/theme.h index 579c34b8a..c56315355 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -229,6 +229,7 @@ class Theme final : public Palette, public ConfigListener BUTTON_PRESSED, BUTTON_PRESSED_OUTLINE, CHECKBOX, + CHECKBOX_OUTLINE, DROPDOWN, LABEL, LABEL_OUTLINE, diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 63e73569f..552eb98fb 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -68,6 +68,7 @@ CheckBox::CheckBox(const Widget2 *const widget, addActionListener(listener); mForegroundColor = getThemeColor(Theme::CHECKBOX); + mForegroundColor2 = getThemeColor(Theme::CHECKBOX_OUTLINE); if (mSkin) { mPadding = mSkin->getPadding(); @@ -98,7 +99,8 @@ void CheckBox::draw(gcn::Graphics* graphics) drawBox(graphics); gcn::Font *const font = getFont(); - graphics->setColor(mForegroundColor); + static_cast(graphics)->setColorAll( + mForegroundColor, mForegroundColor2); font->drawString(graphics, mCaption, mPadding + mImageSize + mSpacing, mPadding); diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 626d1ebe3..c6701f52a 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -91,6 +91,7 @@ class CheckBox final : public gcn::CheckBox, int mImagePadding; int mImageSize; int mSpacing; + gcn::Color mForegroundColor; static int instances; static Skin *mSkin; -- cgit v1.2.3-60-g2f50