[RAPPS] Simplify CAppsListView::SetCheckboxesVisible() into ShowCheckboxes()

This commit is contained in:
Hermès Bélusca-Maïto 2024-09-16 22:47:42 +02:00
parent 385274e2dd
commit 2a2df969b0
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 13 additions and 20 deletions

View file

@ -1109,19 +1109,11 @@ CAppsListView::SetWatermark(const CStringW &Text)
m_Watermark = Text;
}
VOID
CAppsListView::SetCheckboxesVisible(BOOL bIsVisible)
void
CAppsListView::ShowCheckboxes(bool bShow)
{
if (bIsVisible)
{
SetExtendedListViewStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
}
else
{
SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
}
bHasCheckboxes = bIsVisible;
SetExtendedListViewStyle((bShow ? LVS_EX_CHECKBOXES : 0) | LVS_EX_FULLROWSELECT);
bHasCheckboxes = bShow;
}
VOID
@ -1254,7 +1246,7 @@ CAppsListView::Create(HWND hwndParent)
if (hwnd)
{
SetCheckboxesVisible(FALSE);
ShowCheckboxes(false);
}
#pragma push_macro("SubclassWindow")
@ -1363,8 +1355,8 @@ CAppsListView::SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
szText.LoadStringW(IDS_APP_DESCRIPTION);
AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
// disable checkboxes
SetCheckboxesVisible(FALSE);
// Disable checkboxes
ShowCheckboxes(false);
break;
case AppViewTypeAvailableApps:
@ -1379,8 +1371,8 @@ CAppsListView::SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
szText.LoadStringW(IDS_APP_DESCRIPTION);
AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
// enable checkboxes
SetCheckboxesVisible(TRUE);
// Enable checkboxes
ShowCheckboxes(true);
break;
default:

View file

@ -195,7 +195,7 @@ class CAppsListView : public CUiWindow<CWindowImpl<CAppsListView, CListView>>
};
BOOL bIsAscending = TRUE;
BOOL bHasCheckboxes = FALSE;
bool bHasCheckboxes = false;
INT ItemCount = 0;
INT CheckedItemCount = 0;
@ -224,8 +224,9 @@ class CAppsListView : public CUiWindow<CWindowImpl<CAppsListView, CListView>>
VOID
SetWatermark(const CStringW &Text);
VOID
SetCheckboxesVisible(BOOL bIsVisible);
void
ShowCheckboxes(bool bShow);
VOID
ColumnClick(LPNMLISTVIEW pnmv);