1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 07:59:27 +02:00

Bug 2113: When the label editor closes, no control is the focus.

This was caused by commit: 7c0d05f
Problems:
1. LabelDialog::Show() is called both when dialog opens and closes, so SetFocus() was being called when the dialog closed.
2. The call for SetFocus() was only needed for mac and linux, and it would have been better to #ifdef it to prevent unforeseen bugs on other platforms.

This commits fixes the two issues.
This commit is contained in:
David Bailes 2019-05-22 11:43:20 +01:00
parent e09c17d0c5
commit 14601660d9

View File

@ -350,7 +350,11 @@ bool LabelDialog::Show(bool show)
{
bool ret = wxDialogWrapper::Show(show);
mGrid->SetFocus(); // Required for Linux and Mac.
#if defined(__WXMAC__) || defined(__WXGTK__)
if (show) {
mGrid->SetFocus(); // Required for Linux and Mac.
}
#endif
// Set initial row
// (This will not work until the grid is actually displayed)