From 3ae7d2eff3d20c3042ddac4fd4f205812079b94e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Oct 2012 18:31:26 +0300 Subject: Extend checkbox theming. New options: padding - padding from all sides except left imagePadding - padding from left before image imageSize - image size for computation width spacing - space between image and text width = imagePadding + imageSize + spacing + text width + padding height = padding + text height + padding --- src/gui/widgets/checkbox.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/gui/widgets/checkbox.h') diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 654c48d62..0ca579d3b 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -28,6 +28,7 @@ #include "localconsts.h" class Image; +class Skin; /** * Check box widget. Same as the Guichan check box but with custom look. @@ -78,16 +79,18 @@ class CheckBox final : public gcn::CheckBox void keyPressed(gcn::KeyEvent& keyEvent) override; + void adjustSize(); + private: + bool mHasMouse; + int mPadding; + int mImagePadding; + int mImageSize; + int mSpacing; + static int instances; + static Skin *mSkin; static float mAlpha; - bool mHasMouse; - static Image *checkBoxNormal; - static Image *checkBoxChecked; - static Image *checkBoxDisabled; - static Image *checkBoxDisabledChecked; - static Image *checkBoxNormalHi; - static Image *checkBoxCheckedHi; }; #endif -- cgit v1.2.3-70-g09d2