Skip to content

Commit

Permalink
Focus the Tack Title when dialog is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
crsib committed Jun 7, 2023
1 parent 237d38e commit 86e0d7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cloud/audiocom/ShareAudioDialog.cpp
Expand Up @@ -250,7 +250,10 @@ void ShareAudioDialog::Populate(ShuttleGui& s)
const auto title = mProject.GetProjectName();

if (!title.empty())
{
mInitialStatePanel.trackTitle->SetValue(title);
mInitialStatePanel.trackTitle->SetInsertionPoint(title.length());
}

mContinueButton->Enable(mIsAuthorised && mInitialStatePanel.HasValidTitle());

Expand Down Expand Up @@ -625,6 +628,8 @@ void ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(
s.AddSpace(8);
trackTitle = s.AddTextBox({}, {}, 60);
trackTitle->SetName(XO("Track Title").Translation());
trackTitle->SetFocus();
trackTitle->SetMaxLength(100);
s.AddSpace(16);

anonInfoPanel = s.StartInvisiblePanel();
Expand Down Expand Up @@ -717,7 +722,7 @@ void ShareAudioDialog::InitialStatePanel::UpdateUserData()
authorizedInfoPanel->Show();

if (parent.mContinueButton != nullptr)
parent.mContinueButton->Enable(!trackTitle->GetValue().empty());
parent.mContinueButton->Enable(!trackTitle->GetValue().empty());
}

void ShareAudioDialog::InitialStatePanel::OnLinkButtonPressed()
Expand Down

0 comments on commit 86e0d7c

Please sign in to comment.