[RAPPS] Refreshing the Installed list should restore the selected item (#5676)

This commit is contained in:
Whindmar Saksit 2024-08-22 23:21:59 +02:00 committed by GitHub
parent 3b73d62eaa
commit 0e0f99744f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 0 deletions

View file

@ -624,9 +624,14 @@ CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload, BOOL
if (bCheckAvailable)
CheckAvailable();
BOOL TryRestoreSelection = SelectedEnumType == EnumType;
if (SelectedEnumType != EnumType)
SelectedEnumType = EnumType;
CApplicationView::RESTORELISTSELECTION RestoreSelection;
if (TryRestoreSelection)
m_ApplicationView->GetRestoreListSelectionData(RestoreSelection);
if (bReload)
m_Selected.RemoveAll();
@ -667,6 +672,9 @@ CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload, BOOL
{
ATLASSERT(0 && "This should be unreachable!");
}
if (TryRestoreSelection)
m_ApplicationView->RestoreListSelection(RestoreSelection);
m_ApplicationView->SetRedraw(TRUE);
m_ApplicationView->RedrawWindow(0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); // force the child window to repaint
UpdateStatusBarText();