diff options
author | Max Horn | 2004-12-28 21:07:34 +0000 |
---|---|---|
committer | Max Horn | 2004-12-28 21:07:34 +0000 |
commit | a40ed29abd3c164743f2b56c2f73aa4a956b34a8 (patch) | |
tree | 55e1d4f86677ae0fc952db61d07a6740d4a6c53c /gui/widget.cpp | |
parent | 8e42cbde2acfeb043c066058f70b3afb55f235c7 (diff) | |
download | scummvm-rg350-a40ed29abd3c164743f2b56c2f73aa4a956b34a8.tar.gz scummvm-rg350-a40ed29abd3c164743f2b56c2f73aa4a956b34a8.tar.bz2 scummvm-rg350-a40ed29abd3c164743f2b56c2f73aa4a956b34a8.zip |
Renamed _clickedWidget -> _dragWidget; if a drag is in process, send the mouse moved / mouse up events to the widget on which the drag is performed (this fixes at least one bug and improves the user experience)
svn-id: r16362
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r-- | gui/widget.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp index 8fff12dff9..08a88c767a 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -201,15 +201,13 @@ void CheckboxWidget::drawWidget(bool hilite) { SliderWidget::SliderWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint labelWidth, uint32 cmd, uint8 hotkey) : ButtonWidget(boss, x, y, w, h, label, cmd, hotkey), - _value(0), _oldValue(0),_valueMin(0), _valueMax(100), _isDragging(false), + _value(0), _oldValue(0), _valueMin(0), _valueMax(100), _isDragging(false), _labelWidth(labelWidth) { _flags = WIDGET_ENABLED | WIDGET_TRACK_MOUSE | WIDGET_CLEARBG; _type = kSliderWidget; } void SliderWidget::handleMouseMoved(int x, int y, int button) { - // TODO: when the mouse is dragged outside the widget, the slider should - // snap back to the old value. if (isEnabled() && _isDragging && x >= (int)_labelWidth) { int newValue = posToValue(x - _labelWidth); if (newValue < _valueMin) |