1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-20 17:41:13 +02:00

Fixes ordering for commentaries section, header section, attempt to fix focus issue

This commit is contained in:
Vitaly Sverchinsky
2021-06-23 22:14:45 +03:00
committed by Paul Licameli
parent 2f952dcff6
commit 03a5a119b4

View File

@@ -255,14 +255,19 @@ namespace
wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX)//disable frame resize wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX)//disable frame resize
); );
auto mainLayout = new wxBoxSizer(wxVERTICAL); //fixes focus issue with Windows build-in screen reader, but breaks VoiceOver
#if defined(__WXMSW__)
dialog->SetFocus();
#endif
auto headerText = new wxStaticText(dialog, wxID_ANY, header); auto mainLayout = new wxBoxSizer(wxVERTICAL);
headerText->SetFont(wxFont(wxFontInfo().Bold()));
auto headerLayout = new wxBoxSizer(wxHORIZONTAL); auto headerLayout = new wxBoxSizer(wxHORIZONTAL);
headerLayout->Add(new wxStaticBitmap(dialog, wxID_ANY, wxIcon(warning))); headerLayout->Add(new wxStaticBitmap(dialog, wxID_ANY, wxIcon(warning)));
headerLayout->AddSpacer(5); headerLayout->AddSpacer(5);
auto headerText = new wxStaticText(dialog, wxID_ANY, header);
headerText->SetFont(wxFont(wxFontInfo().Bold()));
headerLayout->Add(headerText, wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL)); headerLayout->Add(headerText, wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL));
mainLayout->Add(headerLayout, wxSizerFlags().Border(wxALL)); mainLayout->Add(headerLayout, wxSizerFlags().Border(wxALL));
@@ -284,8 +289,13 @@ namespace
wxTextCtrl* commentCtrl = nullptr; wxTextCtrl* commentCtrl = nullptr;
if (onSend != nullptr) if (onSend != nullptr)
{ {
mainLayout->AddSpacer(10);
mainLayout->Add(new wxStaticText(dialog, wxID_ANY, _("Comments")), wxSizerFlags().Border(wxALL));
commentCtrl = new wxTextCtrl(dialog, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(500, 100), wxTE_MULTILINE); commentCtrl = new wxTextCtrl(dialog, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(500, 100), wxTE_MULTILINE);
commentCtrl->SetMaxLength(MaxUserCommentLength); commentCtrl->SetMaxLength(MaxUserCommentLength);
mainLayout->Add(commentCtrl, wxSizerFlags().Border(wxALL).Expand());
} }
if (onSend != nullptr && commentCtrl != nullptr) if (onSend != nullptr && commentCtrl != nullptr)
@@ -319,13 +329,6 @@ namespace
buttonsLayout->Add(okButton); buttonsLayout->Add(okButton);
} }
if (commentCtrl != nullptr)
{
mainLayout->AddSpacer(10);
mainLayout->Add(new wxStaticText(dialog, wxID_ANY, _("Comments")), wxSizerFlags().Border(wxALL));
mainLayout->Add(commentCtrl, wxSizerFlags().Border(wxALL).Expand());
}
mainLayout->Add(buttonsLayout, wxSizerFlags().Border(wxALL).Align(wxALIGN_RIGHT)); mainLayout->Add(buttonsLayout, wxSizerFlags().Border(wxALL).Align(wxALIGN_RIGHT));
dialog->SetSizerAndFit(mainLayout); dialog->SetSizerAndFit(mainLayout);
@@ -334,7 +337,6 @@ namespace
}); });
dialog->Show(true); dialog->Show(true);
dialog->SetFocus();
} }
} }