diff options
author | George Hazan <ghazan@miranda.im> | 2022-08-16 19:50:49 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-08-16 19:50:49 +0300 |
commit | 2948d9339597f89a03d3f91a71b9732c3799b428 (patch) | |
tree | c89da32bd4072c6c36fb51f5b0cc55d73a81461b /src | |
parent | 6f0bfb5bc1dd9703130af0d65939bc9db839e58e (diff) |
fixes #3159 (various quirks in the View/Change my details window)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stduserinfo/src/userinfo.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index f2ef8788bd..bd81ec66d7 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -133,11 +133,20 @@ class CUserInfoDlg : public CDlgBase const wchar_t *pwszPrevGroup = nullptr;
for (auto &it : items) {
+ int iImage = 1;
+ if ((it->dwFlags & ODPF_ICON) && it->lParam) {
+ HICON hIcon = IcoLib_GetIconByHandle((HANDLE)it->lParam);
+ if (hIcon) {
+ iImage = ImageList_AddIcon(m_imageList, hIcon);
+ IcoLib_ReleaseIcon(hIcon);
+ }
+ }
+
if (hParent == nullptr || (!hContact && mir_wstrcmp(pwszPrevGroup, it->pwszGroup))) {
TVINSERTSTRUCT tvis = {};
tvis.hInsertAfter = TVI_LAST;
tvis.item.lParam = (LPARAM)it;
- tvis.item.iImage = tvis.item.iSelectedImage = iFolderImage;
+ tvis.item.iImage = tvis.item.iSelectedImage = (it->pwszGroup == 0) ? iFolderImage : iImage;
tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
tvis.item.pszText = (it->pwszGroup == 0) ? pwszRoot : it->pwszGroup;
@@ -145,15 +154,6 @@ class CUserInfoDlg : public CDlgBase pwszPrevGroup = it->pwszGroup;
}
- int iImage = 1;
- if ((it->dwFlags & ODPF_ICON) && it->lParam) {
- HICON hIcon = IcoLib_GetIconByHandle((HANDLE)it->lParam);
- if (hIcon) {
- iImage = ImageList_AddIcon(m_imageList, hIcon);
- IcoLib_ReleaseIcon(hIcon);
- }
- }
-
TVINSERTSTRUCT tvis;
tvis.hParent = hParent;
tvis.hInsertAfter = TVI_LAST;
|