1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-02 08:03:48 +02:00

Fix click without drag and double-click on Pan, Gain, Velocity sliders

This commit is contained in:
Paul Licameli 2017-07-11 12:41:48 -04:00
parent 2231d2d152
commit f8d9c4217c

View File

@ -39,16 +39,20 @@ UIHandle::Result SliderHandle::Click
// Come here for left click or double click
mStartingValue = GetValue();
GetSlider( pProject )->Set(mStartingValue);
GetSlider( pProject )->OnMouseEvent(event);
auto slider = GetSlider( pProject );
slider->OnMouseEvent(event);
const float newValue = slider->Get();
// Make a non-permanent change to the project data:
auto result = SetValue(pProject, newValue);
if (event.ButtonDClick())
// Just did a modal dialog in OnMouseEvent
// Do not start a drag
return RefreshCell | Cancelled;
return result | RefreshCell | Cancelled;
else {
mIsClicked = true;
return RefreshCell;
return result | RefreshCell;
}
}