[Scummvm-cvs-logs] scummvm master -> ee8eb5f1607abaefae41bdf0d3f2e2ae7b18b3c7
sev-
sev at scummvm.org
Sun Apr 17 15:05:52 CEST 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e30a94e6ff GUI: Remove 'sticky button' feature
ee8eb5f160 Merge pull request #749 from salty-horse/sticky_buttons
Commit: e30a94e6ffedf29a6630e04fa2448017fe1c0a75
https://github.com/scummvm/scummvm/commit/e30a94e6ffedf29a6630e04fa2448017fe1c0a75
Author: Ori Avtalion (ori at avtalion.name)
Date: 2016-04-14T18:37:12+03:00
Commit Message:
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.
Changed paths:
gui/predictivedialog.cpp
gui/predictivedialog.h
gui/widget.cpp
gui/widget.h
diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index 9557da1..63b69a3 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -190,7 +190,7 @@ void PredictiveDialog::saveUserDictToFile() {
void PredictiveDialog::handleKeyUp(Common::KeyState state) {
if (_curPressedButton != kNoAct && !_needRefresh) {
- _button[_curPressedButton]->startAnimatePressedState();
+ _button[_curPressedButton]->setUnpressedState();
processButton(_curPressedButton);
}
}
@@ -352,7 +352,7 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) {
}
if (_lastButton != _curPressedButton)
- _button[_lastButton]->stopAnimatePressedState();
+ _button[_lastButton]->setUnpressedState();
if (_curPressedButton != kNoAct && !_needRefresh)
_button[_curPressedButton]->setPressedState();
@@ -604,18 +604,6 @@ void PredictiveDialog::processButton(ButtonId button) {
}
}
-void PredictiveDialog::handleTickle() {
- if (_lastTime) {
- if ((_curTime - _lastTime) > kRepeatDelay) {
- _lastTime = 0;
- }
- }
-
- if (getTickleWidget()) {
- getTickleWidget()->handleTickle();
- }
-}
-
void PredictiveDialog::mergeDicts() {
_unitedDict.dictLineCount = _predictiveDict.dictLineCount + _userDict.dictLineCount;
_unitedDict.dictLine = (char **)calloc(_unitedDict.dictLineCount, sizeof(char *));
diff --git a/gui/predictivedialog.h b/gui/predictivedialog.h
index 4c167c3..1f6bdf8 100644
--- a/gui/predictivedialog.h
+++ b/gui/predictivedialog.h
@@ -43,7 +43,6 @@ public:
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleKeyUp(Common::KeyState state);
virtual void handleKeyDown(Common::KeyState state);
- virtual void handleTickle();
const char *getResult() const { return _predictiveResult; }
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 4143111..03540f7 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)
diff --git a/gui/widget.h b/gui/widget.h
index 4f18195..7f6f0c0 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -201,17 +201,12 @@ public:
void handleMouseDown(int x, int y, int button, int clickCount);
void handleMouseEntered(int button) { if (_duringPress) { setFlags(WIDGET_PRESSED); } else { setFlags(WIDGET_HILITED); } draw(); }
void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED | WIDGET_PRESSED); draw(); }
- void handleTickle();
void setHighLighted(bool enable);
void setPressedState();
- void startAnimatePressedState();
- void stopAnimatePressedState();
-
- void lostFocusWidget() { stopAnimatePressedState(); }
+ void setUnpressedState();
protected:
void drawWidget();
- void wantTickle(bool tickled);
bool _duringPress;
private:
uint32 _lastTime;
Commit: ee8eb5f1607abaefae41bdf0d3f2e2ae7b18b3c7
https://github.com/scummvm/scummvm/commit/ee8eb5f1607abaefae41bdf0d3f2e2ae7b18b3c7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-04-17T15:05:49+02:00
Commit Message:
Merge pull request #749 from salty-horse/sticky_buttons
GUI: Remove 'sticky button' feature
Changed paths:
gui/predictivedialog.cpp
gui/predictivedialog.h
gui/widget.cpp
gui/widget.h
More information about the Scummvm-git-logs
mailing list