aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-04-17 15:05:49 +0200
committerEugene Sandulenko2016-04-17 15:05:49 +0200
commitee8eb5f1607abaefae41bdf0d3f2e2ae7b18b3c7 (patch)
treeb16c1d1349c70a1bf8a8c203b122caadf5652dc8 /gui/widget.cpp
parentbefa0514cdf05e5a595bfd98d5c4f7d07541f24d (diff)
parente30a94e6ffedf29a6630e04fa2448017fe1c0a75 (diff)
downloadscummvm-rg350-ee8eb5f1607abaefae41bdf0d3f2e2ae7b18b3c7.tar.gz
scummvm-rg350-ee8eb5f1607abaefae41bdf0d3f2e2ae7b18b3c7.tar.bz2
scummvm-rg350-ee8eb5f1607abaefae41bdf0d3f2e2ae7b18b3c7.zip
Merge pull request #749 from salty-horse/sticky_buttons
GUI: Remove 'sticky button' feature
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)