From: Carl Hetherington Date: Tue, 30 Jan 2024 00:27:25 +0000 (+0100) Subject: Simplify and improve performance of credits list. X-Git-Tag: v2.16.75~6 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=34bc66326680d9c985c716b5842e13731566352b;hp=18321cac11747acd1718d34f29a076525e6020cc Simplify and improve performance of credits list. --- 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 sizers; - - for (int i = 0; i < N; ++i) { - sizers.push_back (new wxBoxSizer (wxVERTICAL)); - overall_sizer->Add (sizers.back (), 1, wxEXPAND | wxALL, 6); - } - + vector 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;