mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-25 15:53:52 +02:00
Further speed up to showing preferences.
We now don't sort the list until a view is selected. Also we create it with nodes open, rather than creating with nodes closed and then separately opening them. Instead of 3 sorts at initialisation only one happens now. AX info is only updated after a sort, so this may be 3x faster for screen reader users too.
This commit is contained in:
@@ -142,7 +142,9 @@ void KeyConfigPrefs::Populate()
|
||||
|
||||
mManager = project->GetCommandManager();
|
||||
|
||||
RefreshBindings();
|
||||
// For speed, don't sort here. We're just creating.
|
||||
// Instead sort when we do SetView later in this function.
|
||||
RefreshBindings(false);
|
||||
|
||||
if (mViewByTree->GetValue()) {
|
||||
mViewType = ViewByTree;
|
||||
@@ -294,7 +296,7 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
Layout();
|
||||
}
|
||||
|
||||
void KeyConfigPrefs::RefreshBindings()
|
||||
void KeyConfigPrefs::RefreshBindings(bool bSort)
|
||||
{
|
||||
wxArrayString Labels;
|
||||
wxArrayString Categories;
|
||||
@@ -316,8 +318,10 @@ void KeyConfigPrefs::RefreshBindings()
|
||||
Categories,
|
||||
Prefixes,
|
||||
Labels,
|
||||
mKeys);
|
||||
mView->ExpandAll();
|
||||
mKeys,
|
||||
bSort);
|
||||
//Not needed as new nodes are already shown expanded.
|
||||
//mView->ExpandAll();
|
||||
|
||||
mNewKeys = mKeys;
|
||||
}
|
||||
@@ -351,7 +355,7 @@ void KeyConfigPrefs::OnImport(wxCommandEvent & WXUNUSED(event))
|
||||
wxOK | wxCENTRE, this);
|
||||
}
|
||||
|
||||
RefreshBindings();
|
||||
RefreshBindings(true);
|
||||
}
|
||||
|
||||
void KeyConfigPrefs::OnExport(wxCommandEvent & WXUNUSED(event))
|
||||
@@ -391,7 +395,7 @@ void KeyConfigPrefs::OnDefaults(wxCommandEvent & WXUNUSED(event))
|
||||
mManager->SetKeyFromIndex(i, mNewKeys[i]);
|
||||
}
|
||||
|
||||
RefreshBindings();
|
||||
RefreshBindings(true);
|
||||
}
|
||||
|
||||
void KeyConfigPrefs::OnHotkeyKeyDown(wxKeyEvent & e)
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
private:
|
||||
void Populate();
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
void RefreshBindings();
|
||||
void RefreshBindings(bool bSort);
|
||||
wxString NameFromKey(const wxString & key);
|
||||
void SetKeyForSelected(const wxString & key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user