diff options
author | George Hazan <ghazan@miranda.im> | 2020-04-10 19:47:43 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-04-10 19:47:43 +0300 |
commit | 6938f9a6faf85e0d7ae81fc36174772d52caa47c (patch) | |
tree | 598bed54e41b9422e9e4af3dab38d2faf8abc5ad /src | |
parent | 3a1018cabbee215a0ccebe260c4fd1ed5870121e (diff) |
fixes #2311 (Collapse multiple nested contact list groups with arrow keys)
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/clc.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 3e529e2e02..31f5c078f1 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -715,19 +715,27 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (hit == -1)
return 0;
- if (changeGroupExpand == 1 && contact->type == CLCIT_CONTACT) {
- if (group == &dat->list)
- return 0;
- dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, -1);
- selMoved = 1;
- }
- else {
- if (contact->type == CLCIT_GROUP)
- g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, changeGroupExpand == 2);
- return 0;
+ if (changeGroupExpand == 1) {
+ switch (contact->type) {
+ case CLCIT_GROUP:
+ if (contact->group->expanded)
+ break;
+ __fallthrough;
+ case CLCIT_CONTACT:
+ if (group == &dat->list)
+ return 0;
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, -1);
+ goto LBL_MoveSelection;
+ }
}
+
+ if (contact->type == CLCIT_GROUP)
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, changeGroupExpand == 2);
+ return 0;
}
+
if (selMoved) {
+LBL_MoveSelection:
if (!dat->bFilterSearch)
dat->szQuickSearch[0] = 0;
if (dat->selection >= g_clistApi.pfnGetGroupContentsCount(&dat->list, 1))
|