summaryrefslogtreecommitdiff
path: root/src/gui/widgets/widget2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/widget2.h')
-rw-r--r--src/gui/widgets/widget2.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h
index 9911d48f6..dd0f0f6fe 100644
--- a/src/gui/widgets/widget2.h
+++ b/src/gui/widgets/widget2.h
@@ -34,6 +34,7 @@ class Widget2
Widget2(const Widget2 *const widget) :
mPalette(widget ? widget->mPalette : 1)
{
+ checkPalette();
}
virtual ~Widget2()
@@ -61,7 +62,20 @@ class Widget2
mPalette = widget ? widget->mPalette : 1;
}
- private:
+ void setPalette(int palette)
+ {
+ mPalette = palette;
+ checkPalette();
+ setWidget2(this);
+ }
+
+ void checkPalette()
+ {
+ if (mPalette < 1 || mPalette > THEME_PALETTES)
+ mPalette = 1;
+ }
+
+ protected:
int mPalette;
};