diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-17 20:14:24 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-17 20:14:55 +0100 |
| commit | 5d72ab4ef501f869f72aac4f50f0cd7c895024f5 (patch) | |
| tree | 393bb779ceb9016675de3f9723b75814ee0c731c /src | |
| parent | cc14550eb27e46a3789a8278aa2095345d36ed6d (diff) | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/language_tag_dialog.cc | 8 |
1 files changed, 6 insertions, 2 deletions
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<dcp::LanguageTag::RegionSubtag> get () const { if (!_list->selected_subtag()) { - return optional<dcp::LanguageTag::RegionSubtag>(); + 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()); } |
