diff options
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r-- | src/gui/widgets/button.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index ec0215206..1ae22aabe 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -70,6 +70,10 @@ Button::Button(const Widget2 *const widget) : mMode(0), mXOffset(0), mYOffset(0), + mEnabledColor(getThemeColor(Theme::BUTTON)), + mDisabledColor(getThemeColor(Theme::BUTTON_DISABLED)), + mHighlightedColor(getThemeColor(Theme::BUTTON_HIGHLIGHTED)), + mPressedColor(getThemeColor(Theme::BUTTON_PRESSED)), mImages(nullptr), mImageSet(nullptr), mImageWidth(0), @@ -95,6 +99,10 @@ Button::Button(const Widget2 *const widget, mMode(0), mXOffset(0), mYOffset(0), + mEnabledColor(getThemeColor(Theme::BUTTON)), + mDisabledColor(getThemeColor(Theme::BUTTON_DISABLED)), + mHighlightedColor(getThemeColor(Theme::BUTTON_HIGHLIGHTED)), + mPressedColor(getThemeColor(Theme::BUTTON_PRESSED)), mImages(nullptr), mImageSet(nullptr), mImageWidth(0), @@ -126,6 +134,10 @@ Button::Button(const Widget2 *const widget, mMode(0), mXOffset(0), mYOffset(0), + mEnabledColor(getThemeColor(Theme::BUTTON)), + mDisabledColor(getThemeColor(Theme::BUTTON_DISABLED)), + mHighlightedColor(getThemeColor(Theme::BUTTON_HIGHLIGHTED)), + mPressedColor(getThemeColor(Theme::BUTTON_PRESSED)), mImages(nullptr), mImageSet(nullptr), mImageWidth(imageWidth), @@ -157,6 +169,10 @@ Button::Button(const Widget2 *const widget, const std::string &imageName, mMode(0), mXOffset(0), mYOffset(0), + mEnabledColor(getThemeColor(Theme::BUTTON)), + mDisabledColor(getThemeColor(Theme::BUTTON_DISABLED)), + mHighlightedColor(getThemeColor(Theme::BUTTON_HIGHLIGHTED)), + mPressedColor(getThemeColor(Theme::BUTTON_PRESSED)), mImages(nullptr), mImageSet(nullptr), mImageWidth(imageWidth), @@ -192,10 +208,6 @@ void Button::init() updateAlpha(); } - mEnabledColor = getThemeColor(Theme::BUTTON); - mDisabledColor = getThemeColor(Theme::BUTTON_DISABLED); - mHighlightedColor = getThemeColor(Theme::BUTTON_HIGHLIGHTED); - mPressedColor = getThemeColor(Theme::BUTTON_PRESSED); mInstances++; } |