diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-01-30 01:27:25 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-02-05 22:13:09 +0100 |
| commit | 34bc66326680d9c985c716b5842e13731566352b (patch) | |
| tree | d8b7a25416cb4cd2275a2398833dcfb558caa24c | |
| parent | 18321cac11747acd1718d34f29a076525e6020cc (diff) | |
Simplify and improve performance of credits list.
| -rw-r--r-- | src/wx/about_dialog.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc index b643eb823..2c742cce3 100644 --- a/src/wx/about_dialog.cc +++ b/src/wx/about_dialog.cc @@ -263,22 +263,23 @@ AboutDialog::add_section (wxString name, wxArrayString credits) panel->SetScrollRate (0, 32); auto overall_sizer = new wxBoxSizer (wxHORIZONTAL); - vector<wxSizer*> sizers; - - for (int i = 0; i < N; ++i) { - sizers.push_back (new wxBoxSizer (wxVERTICAL)); - overall_sizer->Add (sizers.back (), 1, wxEXPAND | wxALL, 6); - } - + vector<wxString> strings(N); int c = 0; for (size_t i = 0; i < credits.Count(); ++i) { - add_label_to_sizer (sizers[c], panel, credits[i], false); + strings[c] += credits[i] + wxT("\n"); ++c; if (c == N) { c = 0; } } + for (int i = 0; i < N; ++i) { + auto label = new wxStaticText(panel, wxID_ANY, strings[i]); + auto sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(label); + overall_sizer->Add(sizer, 1, wxEXPAND | wxALL, 6); + } + panel->SetSizerAndFit (overall_sizer); _notebook->AddPage (panel, name, first); first = false; |
