mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
Fix click without drag and double-click on Pan, Gain, Velocity sliders
This commit is contained in:
parent
2231d2d152
commit
f8d9c4217c
@ -39,16 +39,20 @@ UIHandle::Result SliderHandle::Click
|
|||||||
|
|
||||||
// Come here for left click or double click
|
// Come here for left click or double click
|
||||||
mStartingValue = GetValue();
|
mStartingValue = GetValue();
|
||||||
GetSlider( pProject )->Set(mStartingValue);
|
auto slider = GetSlider( pProject );
|
||||||
GetSlider( pProject )->OnMouseEvent(event);
|
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())
|
if (event.ButtonDClick())
|
||||||
// Just did a modal dialog in OnMouseEvent
|
// Just did a modal dialog in OnMouseEvent
|
||||||
// Do not start a drag
|
// Do not start a drag
|
||||||
return RefreshCell | Cancelled;
|
return result | RefreshCell | Cancelled;
|
||||||
else {
|
else {
|
||||||
mIsClicked = true;
|
mIsClicked = true;
|
||||||
return RefreshCell;
|
return result | RefreshCell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user