mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-04 17:49:45 +02:00
Bug 1508 - Scrubbing: Release mouse to exit Scrub Mode started by click & drag in Scrub Ruler 'no longer working'
It WAS working, just not the way QA wanted, because releasing mouse click when in the ruler and on the first seek continued the seek/scrub cycle. Introduced a 'mInOneShotMode' variable to complete the baroque behaviour in the way that was requested. Also updated tool tip code to reflect the one-shot and non one-shot difference in tooltip and status.
This commit is contained in:
parent
bf06b0485f
commit
315679dad5
@ -194,6 +194,8 @@ Scrubber::Scrubber(AudacityProject *project)
|
||||
, mProject(project)
|
||||
, mPoller { std::make_unique<ScrubPoller>(*this) }
|
||||
, mOptions {}
|
||||
, mInOneShotMode( false )
|
||||
|
||||
{
|
||||
if (wxTheApp)
|
||||
wxTheApp->Connect
|
||||
|
@ -138,6 +138,9 @@ public:
|
||||
void Pause(bool paused);
|
||||
bool IsPaused() const;
|
||||
void CheckMenuItems();
|
||||
// Bug 1508
|
||||
bool IsOneShotSeeking()const { return mInOneShotMode && IsScrubbing();};
|
||||
bool mInOneShotMode;
|
||||
|
||||
private:
|
||||
void DoScrub(bool seek);
|
||||
|
@ -2138,8 +2138,14 @@ namespace {
|
||||
#else
|
||||
wxMouseState State = wxGetMouseState();
|
||||
if( State.LeftIsDown() )
|
||||
return _("Release and move to Scrub. Drag to Seek.");
|
||||
return _("Move to Scrub, drag to Seek");
|
||||
// Since mouse is down, mention dragging first.
|
||||
// IsScrubbing is true if Scrubbing OR seeking.
|
||||
if( scrubber.IsOneShotSeeking() )
|
||||
return _("Drag to Seek. Release to stop seeking.");
|
||||
else
|
||||
return _("Drag to Seek. Release and move to Scrub.");
|
||||
// Since mouse is up, mention moving first.
|
||||
return _("Move to Scrub. Drag to Seek.");
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -2457,6 +2463,10 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
return;
|
||||
}
|
||||
else if( !HasCapture() && evt.LeftUp() && inScrubZone ) {
|
||||
if( scrubber.IsOneShotSeeking() ){
|
||||
scrubber.mInOneShotMode = false;
|
||||
return;
|
||||
}
|
||||
//wxLogDebug("up");
|
||||
// mouse going up => we shift to scrubbing.
|
||||
scrubber.MarkScrubStart(evt.m_x,
|
||||
@ -2472,6 +2482,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
bool repaint_all = false;
|
||||
if (evt.LeftDown()) {
|
||||
//wxLogDebug("down");
|
||||
scrubber.mInOneShotMode = !scrubber.IsScrubbing();
|
||||
scrubber.MarkScrubStart(evt.m_x,
|
||||
TracksPrefs::GetPinnedHeadPreference(), false);
|
||||
UpdateStatusBarAndTooltips(StatusChoice::EnteringScrubZone);
|
||||
|
Loading…
x
Reference in New Issue
Block a user