From 18b6055c46e828f621192e6c9fa7ab6a6b1d99aa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Dec 2013 18:46:28 +0300 Subject: add theme option into checkbox to hide X icon (draw box). New theme option: drawBox --- src/gui/widgets/checkbox.cpp | 6 ++++-- src/gui/widgets/checkbox.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index c8710c573..71783794b 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -47,7 +47,8 @@ CheckBox::CheckBox(const Widget2 *const widget, mImagePadding(0), mImageSize(9), mSpacing(2), - mHasMouse(false) + mHasMouse(false), + mDrawBox(true) { mForegroundColor2 = getThemeColor(Theme::CHECKBOX_OUTLINE); if (instances == 0) @@ -74,6 +75,7 @@ CheckBox::CheckBox(const Widget2 *const widget, mImagePadding = mSkin->getOption("imagePadding"); mImageSize = mSkin->getOption("imageSize"); mSpacing = mSkin->getOption("spacing"); + mDrawBox = mSkin->getOption("drawBox", 1); } adjustSize(); } @@ -129,7 +131,7 @@ void CheckBox::updateAlpha() void CheckBox::drawBox(gcn::Graphics *const graphics) { - if (!mSkin) + if (!mSkin || !mDrawBox) return; const ImageRect &rect = mSkin->getBorder(); diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index e23ffda46..c28eab90b 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -90,6 +90,7 @@ class CheckBox final : public gcn::CheckBox, int mImageSize; int mSpacing; bool mHasMouse; + bool mDrawBox; static int instances; static Skin *mSkin; -- cgit v1.2.3-70-g09d2