mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Cleanup.
This commit is contained in:
parent
ef55909da2
commit
99ff48497b
@ -780,16 +780,12 @@ void CDialogAbout::CTabSkins::UpdateMeasureList(CMeterWindow* meterWindow)
|
|||||||
++lvi.iItem;
|
++lvi.iItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
int topIndex = ListView_GetTopIndex(item);
|
|
||||||
int countPerPage = ListView_GetCountPerPage(item);
|
|
||||||
int selIndex = ListView_GetNextItem(item, -1, LVNI_FOCUSED | LVNI_SELECTED);
|
|
||||||
|
|
||||||
lvi.iGroupId = 1;
|
lvi.iGroupId = 1;
|
||||||
const auto& variables = m_SkinWindow->GetParser().GetVariables();
|
const auto& variables = m_SkinWindow->GetParser().GetVariables();
|
||||||
for (auto iter = variables.cbegin(); iter != variables.cend(); ++iter)
|
for (auto iter = variables.cbegin(); iter != variables.cend(); ++iter)
|
||||||
{
|
{
|
||||||
lvi.pszText = (WCHAR*)(*iter).first.c_str();
|
lvi.pszText = (WCHAR*)(*iter).first.c_str();
|
||||||
lvi.lParam = (LPARAM)&(*iter).first;
|
lvi.lParam = (LPARAM)lvi.pszText;
|
||||||
|
|
||||||
if (lvi.iItem < count)
|
if (lvi.iItem < count)
|
||||||
{
|
{
|
||||||
@ -812,13 +808,13 @@ void CDialogAbout::CTabSkins::UpdateMeasureList(CMeterWindow* meterWindow)
|
|||||||
--count;
|
--count;
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView_SortItems(item, ListSortProc, 0);
|
int selIndex = ListView_GetNextItem(item, -1, LVNI_FOCUSED | LVNI_SELECTED);
|
||||||
|
|
||||||
// Ensure that the visible same items are visible
|
ListView_SortItems(item, ListSortProc, 0);
|
||||||
ListView_EnsureVisible(item, topIndex - countPerPage + 1, FALSE);
|
|
||||||
|
|
||||||
if (selIndex != -1)
|
if (selIndex != -1)
|
||||||
{
|
{
|
||||||
|
// Re-select previously selected item
|
||||||
ListView_SetItemState(item, selIndex, LVIS_FOCUSED | LVNI_SELECTED, LVIS_FOCUSED | LVNI_SELECTED);
|
ListView_SetItemState(item, selIndex, LVIS_FOCUSED | LVNI_SELECTED, LVIS_FOCUSED | LVNI_SELECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,9 +829,7 @@ int CALLBACK CDialogAbout::CTabSkins::ListSortProc(LPARAM lParam1, LPARAM lParam
|
|||||||
if (!lParam2) return 1;
|
if (!lParam2) return 1;
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
const std::wstring* str1 = (const std::wstring*)lParam1;
|
return wcscmp((const WCHAR*)lParam1, (const WCHAR*)lParam2);
|
||||||
const std::wstring* str2 = (const std::wstring*)lParam2;
|
|
||||||
return wcscmp(str1->c_str(), str2->c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user