mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 00:50:52 +02:00
More scrub phase 2 improvements...
Context menu for scrub head shows checkmarks, and is available during scrub Enable scrubbing only when the scrub bar shows
This commit is contained in:
commit
1b4d198b69
@ -763,9 +763,20 @@ void Scrubber::PopulateMenu(wxMenu &menu)
|
|||||||
{
|
{
|
||||||
int id = CMD_ID;
|
int id = CMD_ID;
|
||||||
auto cm = mProject->GetCommandManager();
|
auto cm = mProject->GetCommandManager();
|
||||||
|
const MenuItem *checkedItem =
|
||||||
|
HasStartedScrubbing()
|
||||||
|
? &FindMenuItem(mSmoothScrollingScrub, mAlwaysSeeking)
|
||||||
|
: nullptr;
|
||||||
for (const auto &item : menuItems) {
|
for (const auto &item : menuItems) {
|
||||||
if (cm->GetEnabled(item.name))
|
if (cm->GetEnabled(item.name)) {
|
||||||
|
#ifdef CHECKABLE_SCRUB_MENU_ITEMS
|
||||||
|
menu.AppendCheckItem(id, item.label);
|
||||||
|
if(&item == checkedItem)
|
||||||
|
menu.FindItem(id)->Check();
|
||||||
|
#else
|
||||||
menu.Append(id, item.label);
|
menu.Append(id, item.label);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
++id;
|
++id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2115,7 +2115,8 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
const bool inScrubZone =
|
const bool inScrubZone =
|
||||||
// only if scrubbing is allowed now
|
// only if scrubbing is allowed now
|
||||||
mProject->GetScrubber().CanScrub() &&
|
mProject->GetScrubber().CanScrub() &&
|
||||||
evt.m_y < IndicatorBigHeight();
|
mShowScrubbing &&
|
||||||
|
mScrubZone.Contains(evt.GetPosition());
|
||||||
|
|
||||||
const bool changeInScrubZone = (inScrubZone != mPrevInScrubZone);
|
const bool changeInScrubZone = (inScrubZone != mPrevInScrubZone);
|
||||||
mPrevInScrubZone = inScrubZone;
|
mPrevInScrubZone = inScrubZone;
|
||||||
@ -2156,6 +2157,21 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle popup menus
|
||||||
|
if (evt.RightDown() && !(evt.LeftIsDown())) {
|
||||||
|
if(inScrubZone)
|
||||||
|
ShowScrubMenu(evt.GetPosition());
|
||||||
|
else
|
||||||
|
ShowMenu(evt.GetPosition());
|
||||||
|
|
||||||
|
// dismiss and clear Quick-Play indicator
|
||||||
|
HideQuickPlayIndicator();
|
||||||
|
|
||||||
|
if (HasCapture())
|
||||||
|
ReleaseMouse();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (scrubber.HasStartedScrubbing()) {
|
if (scrubber.HasStartedScrubbing()) {
|
||||||
// If already clicked for scrub, preempt the usual event handling,
|
// If already clicked for scrub, preempt the usual event handling,
|
||||||
// no matter what the y coordinate.
|
// no matter what the y coordinate.
|
||||||
@ -2216,20 +2232,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evt.RightDown() && !(evt.LeftIsDown())) {
|
if (inScrubZone) {
|
||||||
if(inScrubZone)
|
|
||||||
ShowScrubMenu(evt.GetPosition());
|
|
||||||
else
|
|
||||||
ShowMenu(evt.GetPosition());
|
|
||||||
|
|
||||||
// dismiss and clear Quick-Play indicator
|
|
||||||
HideQuickPlayIndicator();
|
|
||||||
|
|
||||||
if (HasCapture())
|
|
||||||
ReleaseMouse();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (inScrubZone) {
|
|
||||||
if (evt.LeftDown())
|
if (evt.LeftDown())
|
||||||
scrubber.MarkScrubStart(evt.m_x, false, false);
|
scrubber.MarkScrubStart(evt.m_x, false, false);
|
||||||
UpdateStatusBar(StatusChoice::EnteringScrubZone);
|
UpdateStatusBar(StatusChoice::EnteringScrubZone);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user