From: Carl Hetherington Date: Wed, 17 Mar 2021 19:14:24 +0000 (+0100) Subject: After a tag search, scroll the list so we can see the best results. X-Git-Tag: v2.15.136~14 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=5d72ab4ef501f869f72aac4f50f0cd7c895024f5 After a tag search, scroll the list so we can see the best results. Otherwise if you search when the list is scrolled down you wonder why you aren't seeing the results you expect from the search. --- diff --git a/src/wx/language_tag_dialog.cc b/src/wx/language_tag_dialog.cc index e0f6ef883..6968b1911 100644 --- a/src/wx/language_tag_dialog.cc +++ b/src/wx/language_tag_dialog.cc @@ -159,7 +159,7 @@ public: optional get () const { if (!_list->selected_subtag()) { - return optional(); + return {}; } return dcp::LanguageTag::RegionSubtag(_list->selected_subtag()->subtag); @@ -171,7 +171,11 @@ public: private: void search_changed () { - _list->set_search (_search->GetValue().ToStdString()); + auto search = _search->GetValue(); + _list->set_search (search.ToStdString()); + if (search.Length() > 0) { + _list->EnsureVisible (0); + } SearchChanged (_search->GetValue().ToStdString()); }