diff options
author | George Hazan <george.hazan@gmail.com> | 2023-07-23 21:08:23 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-07-23 21:08:23 +0300 |
commit | 97846e5e80ca89b0307d740e71cd488895ac42c6 (patch) | |
tree | fc48e0f23fa9062a29fff6414210e21f6077dac9 /plugins | |
parent | 17b316e3e7bce8ca2f51efdc8824451c4be89b8f (diff) |
let boolean variables inside ClcGroup be boolean
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Clist_modern/src/groupmenu.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 18 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcidents.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcmsgs.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcpaint.cpp | 30 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcutils.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_rowheight_funcs.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_viewmodebar.cpp | 34 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.h | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcpaint.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcutils.cpp | 40 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/rowheight_funcs.cpp | 2 |
14 files changed, 64 insertions, 101 deletions
diff --git a/plugins/Clist_modern/src/groupmenu.cpp b/plugins/Clist_modern/src/groupmenu.cpp index c3d6d99d0b..d91e63214b 100644 --- a/plugins/Clist_modern/src/groupmenu.cpp +++ b/plugins/Clist_modern/src/groupmenu.cpp @@ -118,7 +118,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM) return 0;
bool showOfflineinGroup = CLCItems_IsShowOfflineGroup(group);
- bool gray2 = group->hideOffline == 0;
+ bool gray2 = !group->bHideOffline;
Menu_EnableItem(hShowOfflineUsersHereMenuItem, gray2);
Menu_SetChecked(hShowOfflineUsersHereMenuItem, showOfflineinGroup && gray2);
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 2749972689..ce1facd553 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -239,7 +239,7 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const wchar_ int contactScanIndex = group->scanIndex;
int foundindex;
for (; group; group = group->parent)
- g_clistApi.pfnSetGroupExpand(hwnd, dat, group, 1);
+ Clist_SetGroupExpand(hwnd, dat, group, 1);
foundindex = g_clistApi.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
if (fReturnAsFound)
return foundindex;
@@ -253,7 +253,7 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const wchar_ group->scanIndex = contactScanIndex;
}
if (cc->type == CLCIT_GROUP) {
- if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || cc->group->expanded) {
+ if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || cc->group->bExpanded) {
group = cc->group;
group->scanIndex = 0;
continue;
@@ -278,7 +278,7 @@ static bool clcItemNotHiddenOffline(ClcGroup *group, ClcContact *contact) if (!group)
return false;
- if (group->hideOffline)
+ if (group->bHideOffline)
return false;
if (CLCItems_IsShowOfflineGroup(group))
@@ -556,14 +556,14 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM }
else if (contact->type == CLCIT_GROUP) {
if (changeGroupExpand == 1) {
- if (!contact->group->expanded) {
+ if (!contact->group->bExpanded) {
dat->selection--;
selMoved = 1;
}
- else g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, 0);
+ else Clist_SetGroupExpand(hwnd, dat, contact->group, 0);
}
else if (changeGroupExpand == 2) {
- g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, 1);
+ Clist_SetGroupExpand(hwnd, dat, contact->group, 1);
dat->selection++;
selMoved = 1;
}
@@ -755,7 +755,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lP ClcGroup *selgroup;
ClcContact *selcontact;
dat->selection = cliGetRowByIndex(dat, dat->selection, &selcontact, &selgroup);
- g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
+ Clist_SetGroupExpand(hwnd, dat, contact->group, -1);
if (dat->selection != -1) {
dat->selection = cliGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
if (dat->selection == -1)
@@ -1374,10 +1374,10 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam if (contact && contact->iImage == lParam)
return 0;
- if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline) && clcItemNotHiddenOffline(group, contact))
+ if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->bHideOffline) && clcItemNotHiddenOffline(group, contact))
shouldShow = TRUE;
- if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline)) { // CLVM changed
+ if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->bHideOffline)) { // CLVM changed
if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
Clist_RemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index 29be4b6442..7ed304fed8 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -45,7 +45,7 @@ int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex) if (cc->group == subgroup && contactIndex == -1)
return count - 1;
- if (cc->group->expanded) {
+ if (cc->group->bExpanded) {
group = cc->group;
group->scanIndex = 0;
subcontactscount = 0;
@@ -122,7 +122,7 @@ int cliGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup }
index++;
- if (cc->type == CLCIT_GROUP && cc->group->expanded) {
+ if (cc->type == CLCIT_GROUP && cc->group->bExpanded) {
group = cc->group;
group->scanIndex = 0;
continue;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 19540468c0..8ee400d56b 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -196,7 +196,7 @@ void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int update bool CLCItems_IsShowOfflineGroup(ClcGroup *group)
{
if (!group) return false;
- if (group->hideOffline) return false;
+ if (group->bHideOffline) return false;
uint32_t groupFlags = 0;
Clist_GroupGetName(group->groupId, &groupFlags);
@@ -296,7 +296,7 @@ int GetNewSelection(ClcGroup *group, int selection, int direction) return lastcount;
ClcContact *cc = group->cl[group->scanIndex];
- if (cc->type == CLCIT_GROUP && (cc->group->expanded)) {
+ if (cc->type == CLCIT_GROUP && cc->group->bExpanded) {
group = cc->group;
group->scanIndex = 0;
continue;
@@ -376,7 +376,7 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly) }
ClcContact *cc = group->cl[group->scanIndex];
- if (cc->type == CLCIT_GROUP && (!(visibleOnly & 0x01) || cc->group->expanded)) {
+ if (cc->type == CLCIT_GROUP && (!(visibleOnly & 0x01) || cc->group->bExpanded)) {
group = cc->group;
group->scanIndex = 0;
count += group->cl.getCount();
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index 663872a25c..3c65f72c37 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -188,7 +188,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
- g_clistApi.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
+ Clist_SetGroupExpand(hwnd, dat, tgroup, 1);
if (!contact->iSubNumber) {
index = group->cl.indexOf(contact);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index aeb4dd1ade..099a27e63e 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -147,7 +147,7 @@ int CLCPaint::GetBasicFontID(ClcContact *contact) {
switch (contact->type) {
case CLCIT_GROUP:
- return (contact->group->expanded) ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS;
+ return (contact->group->bExpanded) ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS;
case CLCIT_INFO:
return (contact->flags & CLCIIF_GROUPFONT) ? FONTID_OPENGROUPS : FONTID_CONTACTS;
@@ -489,7 +489,7 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac case CLCIT_GROUP:
_AddParamShort(mpModernMask, hi_Type, hi_Group);
if (Drawing->group) {
- _AddParamShort(mpModernMask, hi_Open, Drawing->group->expanded ? hi_True : hi_False);
+ _AddParamShort(mpModernMask, hi_Open, Drawing->group->bExpanded ? hi_True : hi_False);
_AddParamShort(mpModernMask, hi_IsEmpty, (Drawing->group->cl.getCount() == 0) ? hi_True : hi_False);
}
break;
@@ -617,7 +617,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R int iImage = -1;
// Get image
if (Drawing->type == CLCIT_GROUP) {
- iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ iImage = Drawing->group->bExpanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
}
else if (Drawing->type == CLCIT_CONTACT)
iImage = Drawing->iImage;
@@ -726,7 +726,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R // Has to draw the count?
if (szCounts && mir_wstrlen(szCounts) > 0) {
// calc width and height
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
ske_DrawText(hdcMem, L" ", 1, &count_rc, DT_CALCRECT | DT_NOPREFIX);
count_size.cx = count_rc.right - count_rc.left;
space_width = count_size.cx;
@@ -740,7 +740,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R {
SIZE grp_size = { 0 };
int wid = fr_rc.right - fr_rc.left;
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, nullptr);
GetTextSize(&grp_size, hdcMem, fr_rc, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight);
if (wid - count_size.cx > grp_size.cx) {
@@ -768,7 +768,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R }
uTextFormat |= DT_VCENTER;
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, nullptr);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
@@ -782,7 +782,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R }
if (szCounts && mir_wstrlen(szCounts) > 0) {
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
@@ -809,7 +809,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R space_size.cx = space_rc.right - space_rc.left;
space_size.cy = min(space_rc.bottom - space_rc.top, fr_rc.bottom - fr_rc.top);
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &counts_rc, DT_CALCRECT);
counts_size.cx = counts_rc.right - counts_rc.left;
@@ -854,7 +854,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, idx, (int)mir_wstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
if (Drawing->type == CLCIT_GROUP && szCounts && szCounts[0] && counts_rc.right - counts_rc.left > 0) {
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
if (dat->text_rtl != 0) _RTLRect(&counts_rc, free_row_rc.right);
ske_DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &counts_rc, uTextFormat);
if (dat->text_rtl == 0)
@@ -1295,7 +1295,7 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, }
if (cc && subindex == -1) {
- if (cc->type == CLCIT_GROUP && cc->group->expanded) {
+ if (cc->type == CLCIT_GROUP && cc->group->bExpanded) {
group = cc->group;
indent++;
group->scanIndex = 0;
@@ -1577,7 +1577,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT // Get image
iImage = -1;
if (Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon)
- iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ iImage = Drawing->group->bExpanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
else if (Drawing->type == CLCIT_CONTACT)
iImage = Drawing->iImage;
@@ -1702,7 +1702,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT space_size.cx = space_rc.right - space_rc.left;
space_size.cy = min(space_rc.bottom - space_rc.top, free_height);
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
DrawText(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &counts_rc, DT_CALCRECT);
counts_size.cx = counts_rc.right - counts_rc.left;
@@ -1734,7 +1734,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT selection_text_rc = text_rc;
full_text_width = text_width;
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, nullptr);
}
if (dat->row_align_group_mode == 1) { // center
@@ -2113,7 +2113,7 @@ void CLCPaint::_DrawContactIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i int iImage = -1;
// Get image
if (Drawing->type == CLCIT_GROUP) {
- if (!dat->row_hide_group_icon) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ if (!dat->row_hide_group_icon) iImage = Drawing->group->bExpanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
else iImage = -1;
}
else if (Drawing->type == CLCIT_CONTACT)
@@ -2176,7 +2176,7 @@ void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing // Has to draw the count?
if (szCounts && szCounts[0]) {
- ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
+ ChangeToFont(hdcMem, dat, Drawing->group->bExpanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 8de0df74a2..ef9d199730 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -342,7 +342,7 @@ int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt) ok = 1;
}
else if ((pt.y + dat->yScroll >= cliGetRowTopY(dat, hit + 1) - dat->insertionMarkHitHeight)
- || (contact->type == CLCIT_GROUP && contact->group->expanded && contact->group->cl.getCount() > 0)) {
+ || (contact->type == CLCIT_GROUP && contact->group->bExpanded && contact->group->cl.getCount() > 0)) {
//could be insertion mark (below)
topItem = hit; bottomItem = hit + 1;
topcontact = contact; topgroup = group;
@@ -648,12 +648,12 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk) ClcGroup *ccGroup = group;
int ccScanIndex = group->scanIndex;
for (; group; group = group->parent)
- g_clistApi.pfnSetGroupExpand(hwnd, dat, group, 1);
+ Clist_SetGroupExpand(hwnd, dat, group, 1);
return g_clistApi.pfnGetRowsPriorTo(&dat->list, ccGroup, ccScanIndex + SubCount);
}
if (cc->type == CLCIT_GROUP) {
- if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || cc->group->expanded) {
+ if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || cc->group->bExpanded) {
group = cc->group;
group->scanIndex = 0;
SubCount = 0;
@@ -679,7 +679,7 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk) ClcGroup *ccGroup = group;
int ccScanIndex = group->scanIndex;
for (; group; group = group->parent)
- g_clistApi.pfnSetGroupExpand(hwnd, dat, group, 1);
+ Clist_SetGroupExpand(hwnd, dat, group, 1);
if (!cc->bSubExpanded)
ExpandMetaContact(hwnd, cc, dat);
return g_clistApi.pfnGetRowsPriorTo(&dat->list, ccGroup, ccScanIndex + SubCount + i + 1);
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index bd54fbd582..4049d6df0a 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -62,7 +62,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) wchar_t *szCounts = Clist_GetGroupCountsText(dat, contact);
// Has the count?
if (szCounts && szCounts[0])
- tmp = max(tmp, dat->fontModernInfo[contact->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS].fontHeight);
+ tmp = max(tmp, dat->fontModernInfo[contact->group->bExpanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS].fontHeight);
}
tmp = max(tmp, ICON_HEIGHT);
tmp = max(tmp, dat->row_min_heigh);
@@ -101,7 +101,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) if (szCounts && mir_wstrlen(szCounts) > 0) {
RECT count_rc = { 0 };
// calc width and height
- g_clcPainter.ChangeToFont(hdc, dat, contact->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
+ g_clcPainter.ChangeToFont(hdc, dat, contact->group->bExpanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, nullptr);
ske_DrawText(hdc, L" ", 1, &count_rc, DT_CALCRECT | DT_NOPREFIX);
size.cx += count_rc.right - count_rc.left;
count_rc.right = 0;
@@ -441,7 +441,7 @@ void RowHeights_CalcRowHeights(ClcData *dat, HWND hwnd) }
if (subindex == -1) {
- if (group->cl[group->scanIndex]->type == CLCIT_GROUP && group->cl[group->scanIndex]->group->expanded) {
+ if (group->cl[group->scanIndex]->type == CLCIT_GROUP && group->cl[group->scanIndex]->group->bExpanded) {
group = group->cl[group->scanIndex]->group;
indent++;
group->scanIndex = 0;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 6e6ea22632..a6239a2a5a 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -1255,8 +1255,10 @@ void ApplyViewMode(const char *szName) g_clistApi.pfnSetHideOffline(g_CluiData.bOldHideOffline);
if (g_CluiData.bOldHideEmptyGroups != -1)
SendMessage(g_clistApi.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, g_CluiData.bOldHideEmptyGroups, 0);
- if (g_CluiData.bOldFoldGroups != -1)
- SendMessage(g_clistApi.hwndContactTree, CLM_EXPAND, 0, g_CluiData.bOldFoldGroups ? CLE_COLLAPSE : CLE_EXPAND);
+ if (g_CluiData.bOldFoldGroups != -1) {
+ Clist_GroupRestoreExpanded();
+ SendMessage(g_clistApi.hwndContactTree, CLM_EXPAND, 0, -1);
+ }
g_CluiData.bOldUseGroups = -1;
g_CluiData.bOldHideOffline = -1;
@@ -1347,19 +1349,7 @@ void ApplyViewMode(const char *szName) g_CluiData.bOldHideOffline = -1;
}
- int iValue = (g_CluiData.filterFlags & CLVM_FOLDGROUPS) ? 1 : ((g_CluiData.filterFlags & CLVM_UNFOLDGROUPS) ? 0 : -1);
- if (iValue != -1) {
- if (g_CluiData.bOldFoldGroups == -1)
- g_CluiData.bOldFoldGroups = !Clist::UseGroups;
-
- SendMessage(g_clistApi.hwndContactTree, CLM_EXPAND, 0, iValue ? CLE_COLLAPSE : CLE_EXPAND);
- }
- else if (g_CluiData.bOldFoldGroups != -1) {
- SendMessage(g_clistApi.hwndContactTree, CLM_EXPAND, 0, g_CluiData.bOldFoldGroups ? CLE_COLLAPSE : CLE_EXPAND);
- g_CluiData.bOldFoldGroups = -1;
- }
-
- iValue = (g_CluiData.filterFlags & CLVM_USEGROUPS) ? 1 : ((g_CluiData.filterFlags & CLVM_DONOTUSEGROUPS) ? 0 : -1);
+ int iValue = (g_CluiData.filterFlags & CLVM_USEGROUPS) ? 1 : ((g_CluiData.filterFlags & CLVM_DONOTUSEGROUPS) ? 0 : -1);
if (iValue != -1) {
if (g_CluiData.bOldUseGroups == -1)
g_CluiData.bOldUseGroups = Clist::UseGroups;
@@ -1383,6 +1373,20 @@ void ApplyViewMode(const char *szName) g_CluiData.bOldHideEmptyGroups = -1;
}
+ iValue = (g_CluiData.filterFlags & CLVM_FOLDGROUPS) ? 1 : ((g_CluiData.filterFlags & CLVM_UNFOLDGROUPS) ? 0 : -1);
+ if (iValue != -1) {
+ if (g_CluiData.bOldFoldGroups == -1)
+ Clist_GroupSaveExpanded();
+
+ SendMessage(g_clistApi.hwndContactTree, CLM_EXPAND, 0, iValue ? CLE_COLLAPSE : CLE_EXPAND);
+ g_CluiData.bOldFoldGroups = 1;
+ }
+ else if (g_CluiData.bOldFoldGroups != -1) {
+ Clist_GroupRestoreExpanded();
+ SendMessage(g_clistApi.hwndContactTree, CLM_EXPAND, 0, -1);
+ g_CluiData.bOldFoldGroups = -1;
+ }
+
SetWindowText(hwndSelector, ptrW(mir_utf8decodeW((szName[0] == 13) ? szName + 1 : szName)));
}
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 4924dccd16..86d9a7fe68 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -340,7 +340,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L uint32_t style = GetWindowLongPtr(hwnd, GWL_STYLE);
if (contact->iImage == (uint16_t)lParam)
break;
- if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline || cfg::dat.bFilterEffective)) { // CLVM changed
+ if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->bHideOffline || cfg::dat.bFilterEffective)) { // CLVM changed
if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
Clist_RemoveItemFromGroup(hwnd, group, contact, 0);
@@ -665,7 +665,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L hMenu = Menu_BuildSubGroupMenu(contact->group);
ClientToScreen(hwnd, &pt);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_clistApi.hwndContactList, nullptr);
- CheckMenuItem(hMenu, POPUP_GROUPHIDEOFFLINE, contact->group->hideOffline ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, POPUP_GROUPHIDEOFFLINE, contact->group->bHideOffline ? MF_CHECKED : MF_UNCHECKED);
DestroyMenu(hMenu);
return 0;
}
diff --git a/plugins/Clist_nicer/src/clc.h b/plugins/Clist_nicer/src/clc.h index 8e138f374b..8df56f8ede 100644 --- a/plugins/Clist_nicer/src/clc.h +++ b/plugins/Clist_nicer/src/clc.h @@ -373,7 +373,6 @@ uint32_t INTSORT_GetLastMsgTime(MCONTACT hContact); LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
// clcutils.c
-void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState);
void BeginRenameSelection(HWND hwnd, struct ClcData *dat);
int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, uint32_t *flags);
void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index e7f49f900c..71d811fe6c 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -718,7 +718,7 @@ set_bg_l: oldGroupColor = SetTextColor(hdcMem, sempty->TEXTCOLOR);
}
}
- else if (contact->group->expanded) {
+ else if (contact->group->bExpanded) {
if (!sexpanded->IGNORED) {
rc.left = sexpanded->MARGIN_LEFT + bg_indent_l;
rc.top = y + sexpanded->MARGIN_TOP;
@@ -815,7 +815,7 @@ bgskipped: int iImage;
if (type == CLCIT_GROUP)
- iImage = (contact->group->expanded) ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ iImage = (contact->group->bExpanded) ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
else if (type == CLCIT_CONTACT)
iImage = contact->iImage;
else
@@ -1374,7 +1374,7 @@ bgdone: if (cc->cFlags & ECF_AVATAR)
g_list_avatars++;
- if (cc->type == CLCIT_GROUP && (cc->group->expanded)) {
+ if (cc->type == CLCIT_GROUP && cc->group->bExpanded) {
group = cc->group;
group->scanIndex = 0;
continue;
@@ -1409,7 +1409,7 @@ bgdone: }
index++;
y += dat->row_heights[line_num];
- if (cc->type == CLCIT_GROUP && (cc->group->expanded)) {
+ if (cc->type == CLCIT_GROUP && cc->group->bExpanded) {
group = cc->group;
indent++;
group->scanIndex = 0;
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 1ea0c9f1e2..d26133a099 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -375,46 +375,6 @@ void RecalcScrollBar(HWND hwnd, struct ClcData *dat) SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nm);
}
-void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState)
-{
- int contentCount;
- int groupy;
- int newy;
- int posy;
- RECT clRect;
- NMCLISTCONTROL nm;
-
- if (newState == -1)
- group->expanded ^= 1;
- else {
- if (group->expanded == (newState != 0))
- return;
- group->expanded = newState != 0;
- }
- InvalidateRect(hwnd, nullptr, FALSE);
- contentCount = g_clistApi.pfnGetGroupContentsCount(group, 1);
-
- groupy = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, -1);
- if (dat->selection > groupy && dat->selection < groupy + contentCount) dat->selection = groupy;
- g_clistApi.pfnRecalcScrollBar(hwnd, dat);
-
- GetClientRect(hwnd, &clRect);
- newy = dat->yScroll;
- posy = RowHeight::getItemBottomY(dat, groupy + contentCount);
- if (posy >= newy + clRect.bottom)
- newy = posy - clRect.bottom;
- posy = RowHeight::getItemTopY(dat, groupy);
- if (newy > posy) newy = posy;
- ScrollTo(hwnd, dat, newy, 0);
-
- nm.hdr.code = CLN_EXPANDED;
- nm.hdr.hwndFrom = hwnd;
- nm.hdr.idFrom = GetDlgCtrlID(hwnd);
- nm.hItem = (HANDLE)group->groupId;
- nm.action = (group->expanded);
- SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&nm);
-}
-
static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
diff --git a/plugins/Clist_nicer/src/rowheight_funcs.cpp b/plugins/Clist_nicer/src/rowheight_funcs.cpp index 6a44596915..865c7f30cf 100644 --- a/plugins/Clist_nicer/src/rowheight_funcs.cpp +++ b/plugins/Clist_nicer/src/rowheight_funcs.cpp @@ -152,7 +152,7 @@ void RowHeight::calcRowHeights(ClcData *dat, HWND hwnd) // Calc row height
getRowHeight(dat, cc, line_num, dwStyle);
- if (cc->type == CLCIT_GROUP && (cc->group->expanded & 0x0000ffff)) {
+ if (cc->type == CLCIT_GROUP && cc->group->bExpanded) {
group = cc->group;
group->scanIndex = 0;
continue;
|