aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.cpp
diff options
context:
space:
mode:
authorOri Avtalion2016-04-13 15:02:33 +0300
committerOri Avtalion2016-04-14 18:37:12 +0300
commite30a94e6ffedf29a6630e04fa2448017fe1c0a75 (patch)
treeb30783509e3cdad8e9b8a417a0a7355ea85772d6 /gui/widget.cpp
parent5e4980090198a334b136bcdce16ea6addbe708a2 (diff)
downloadscummvm-rg350-e30a94e6ffedf29a6630e04fa2448017fe1c0a75.tar.gz
scummvm-rg350-e30a94e6ffedf29a6630e04fa2448017fe1c0a75.tar.bz2
scummvm-rg350-e30a94e6ffedf29a6630e04fa2448017fe1c0a75.zip
GUI: Remove 'sticky button' feature
This feature made pressed buttons wait a few moments before returning to an unpressed state. It was half-implemented, and caused several visual bugs. Fixes #7083.
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r--gui/widget.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 4143111e54..03540f7b91 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -299,7 +299,7 @@ ButtonWidget::ButtonWidget(GuiObject *boss, const Common::String &name, const Co
void ButtonWidget::handleMouseUp(int x, int y, int button, int clickCount) {
if (isEnabled() && _duringPress && x >= 0 && x < _w && y >= 0 && y < _h) {
- startAnimatePressedState();
+ setUnpressedState();
sendCommand(_cmd, 0);
}
_duringPress = false;
@@ -344,40 +344,17 @@ void ButtonWidget::setHighLighted(bool enable) {
draw();
}
-void ButtonWidget::handleTickle() {
- if (_lastTime) {
- uint32 curTime = g_system->getMillis();
- if (curTime - _lastTime > kPressedButtonTime) {
- stopAnimatePressedState();
- }
- }
-}
-
void ButtonWidget::setPressedState() {
- wantTickle(true);
setFlags(WIDGET_PRESSED);
clearFlags(WIDGET_HILITED);
draw();
}
-void ButtonWidget::stopAnimatePressedState() {
- wantTickle(false);
- _lastTime = 0;
+void ButtonWidget::setUnpressedState() {
clearFlags(WIDGET_PRESSED);
draw();
}
-void ButtonWidget::startAnimatePressedState() {
- _lastTime = g_system->getMillis();
-}
-
-void ButtonWidget::wantTickle(bool tickled) {
- if (tickled)
- ((GUI::Dialog *)_boss)->setTickleWidget(this);
- else
- ((GUI::Dialog *)_boss)->unSetTickleWidget();
-}
-
#pragma mark -
PicButtonWidget::PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip, uint32 cmd, uint8 hotkey)