Skip to content

Commit

Permalink
focus the selected item in FindBestMatch
Browse files Browse the repository at this point in the history
  • Loading branch information
oltolm committed Nov 10, 2024
1 parent 0f81da0 commit c88bb3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/chmlistctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <chmhtmlnotebook.h>
#include <chminputstream.h>
#include <chmlistctrl.h>
#include <wx/listbase.h>
#include <wx/settings.h>

// Helper
Expand Down Expand Up @@ -100,6 +101,7 @@ void CHMListCtrl::FindBestMatch(const wxString& title)
if (!_items[i]->_title.Left(title.length()).CmpNoCase(title)) {
EnsureVisible(i);
SetItemState(i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
break;
}
}
Expand Down

0 comments on commit c88bb3b

Please sign in to comment.