aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-28 01:05:04 +0300
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit2a9cf65eeb305525c55c4d157ef8b1a104b8f7d7 (patch)
tree67a6671d3268d607369f9f4eecd459ac2b220928
parent00d8d232366f418d3a25046786ab9ab5c90a52c2 (diff)
downloadscummvm-rg350-2a9cf65eeb305525c55c4d157ef8b1a104b8f7d7.tar.gz
scummvm-rg350-2a9cf65eeb305525c55c4d157ef8b1a104b8f7d7.tar.bz2
scummvm-rg350-2a9cf65eeb305525c55c4d157ef8b1a104b8f7d7.zip
GUI: Add mode to skip drawing of button for PicButton
-rw-r--r--gui/widget.cpp7
-rw-r--r--gui/widget.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index f2a29c3100..1d0247883c 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -398,7 +398,7 @@ void ButtonWidget::setUnpressedState() {
PicButtonWidget::PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip, uint32 cmd, uint8 hotkey)
: ButtonWidget(boss, x, y, w, h, "", tooltip, cmd, hotkey),
- _gfx(), _alpha(256), _transparency(false) {
+ _gfx(), _alpha(256), _transparency(false), _showButton(true) {
setFlags(WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG);
_type = kButtonWidget;
@@ -406,7 +406,7 @@ PicButtonWidget::PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, co
PicButtonWidget::PicButtonWidget(GuiObject *boss, const Common::String &name, const char *tooltip, uint32 cmd, uint8 hotkey)
: ButtonWidget(boss, name, "", tooltip, cmd, hotkey),
- _gfx(), _alpha(256), _transparency(false) {
+ _gfx(), _alpha(256), _transparency(false), _showButton(true) {
setFlags(WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG);
_type = kButtonWidget;
}
@@ -449,7 +449,8 @@ void PicButtonWidget::setGfx(int w, int h, int r, int g, int b) {
}
void PicButtonWidget::drawWidget() {
- g_gui.theme()->drawButtonClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), "", _state, getFlags());
+ if (_showButton)
+ g_gui.theme()->drawButtonClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), "", _state, getFlags());
if (_gfx.getPixels()) {
// Check whether the set up surface needs to be converted to the GUI
diff --git a/gui/widget.h b/gui/widget.h
index 0f4b300233..28d7a5b8c0 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -226,6 +226,7 @@ public:
void useAlpha(int alpha) { _alpha = alpha; }
void useThemeTransparency(bool enable) { _transparency = enable; }
+ void setButtonDisplay(bool enable) {_showButton = enable; }
protected:
void drawWidget();
@@ -233,6 +234,7 @@ protected:
Graphics::Surface _gfx;
int _alpha;
bool _transparency;
+ bool _showButton;
};
/* CheckboxWidget */