Skip to content

Commit

Permalink
6168 pitch-and-speed focus fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
saintmatthieu committed Mar 26, 2024
1 parent 7baedbd commit 2315371
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
**********************************************************************/
#include "ClipOverflowButtonHandle.h"
#include "AllThemeResources.h"
#include "ClipParameters.h"
#include "HitTestResult.h"
#include "LowlitClipButton.h"
#include "ProjectHistory.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ UIHandle::Result ClipPitchAndSpeedButtonHandle::DoRelease(
if (auto pProject = project.lock())
PitchAndSpeedDialog::Get(*pProject)
.Retarget(track, clip)
.SetFocus(focusedGroup)
.Show();
.SetFocus(focusedGroup);
});
}
return RefreshCode::RefreshNone;
Expand Down
10 changes: 3 additions & 7 deletions src/tracks/playabletrack/wavetrack/ui/PitchAndSpeedDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void PitchAndSpeedDialog::Destroy(AudacityProject& project)

PitchAndSpeedDialog::PitchAndSpeedDialog(AudacityProject& project)
: wxDialogWrapper(
nullptr, wxID_ANY, XO("Pitch and Speed"), wxDefaultPosition,
FindProjectFrame(&project), wxID_ANY, XO("Pitch and Speed"), wxDefaultPosition,
{ 480, 250 }, wxDEFAULT_DIALOG_STYLE)
, mProject { project }
, mProjectCloseSubscription { ProjectWindow::Get(mProject).Subscribe(
Expand Down Expand Up @@ -276,16 +276,12 @@ PitchAndSpeedDialog& PitchAndSpeedDialog::SetFocus(
nullptr;
if (item)
item->SetFocus();
wxDialog::Show(true);
wxDialog::Raise();
wxDialog::SetFocus();
return *this;
}

PitchAndSpeedDialog& PitchAndSpeedDialog::Show()
{
Show(true);
return *this;
}

void PitchAndSpeedDialog::PopulateOrExchange(ShuttleGui& s)
{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class PitchAndSpeedDialog final :
const WaveTrack::IntervalHolder& wideClip);
PitchAndSpeedDialog&
SetFocus(const std::optional<PitchAndSpeedDialogGroup>& group);
PitchAndSpeedDialog& Show();
void TryRetarget(const TrackPanelMouseEvent& event);

struct PitchShift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,7 @@ void WaveTrackAffordanceControls::StartEditSelectedClipSpeed(
if (!interval)
return;

PitchAndSpeedDialog::Get(project)
.Retarget(track, interval)
.Show()
.SetFocus({});
PitchAndSpeedDialog::Get(project).Retarget(track, interval).SetFocus({});
}

void WaveTrackAffordanceControls::OnRenderClipStretching(
Expand Down

0 comments on commit 2315371

Please sign in to comment.