diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-22 12:30:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-22 12:30:59 +0300 |
commit | 337a21c7b838d8e5135fe3d28b320508442ad69c (patch) | |
tree | 67e74da9b1eb42272184ad387681beed0b724feb | |
parent | f5c571324515ea69e1e031dd2243aecba94e834a (diff) |
- Clist_ClearSearch considered useless;
- pfnDoSelectionDefaultAction rewritten to handle search correctly
-rw-r--r-- | include/m_clistint.h | 1 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 113582 -> 113352 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 109088 -> 108878 bytes | |||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 34 | ||||
-rw-r--r-- | src/mir_app/src/clc.cpp | 23 | ||||
-rw-r--r-- | src/mir_app/src/clcutils.cpp | 10 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 |
9 files changed, 32 insertions, 39 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h index ba542dd915..c2c2906882 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -250,7 +250,6 @@ EXTERN_C MIR_APP_DLL(HANDLE) Clist_ContactToItemHandle(ClcContact *contact, DWOR EXTERN_C MIR_APP_DLL(void) Clist_Broadcast(int msg, WPARAM wParam, LPARAM lParam);
EXTERN_C MIR_APP_DLL(void) Clist_BroadcastAsync(int msg, WPARAM wParam, LPARAM lParam);
-EXTERN_C MIR_APP_DLL(void) Clist_ClearSearch(HWND hwnd, ClcData *dat);
EXTERN_C MIR_APP_DLL(bool) Clist_FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 8c0e0abcfb..b351ed56b0 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 0adb28ee39..df671e8e39 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index e2bf1a11ed..056dae208d 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -449,7 +449,6 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM case VK_RETURN:
pcli->pfnDoSelectionDefaultAction(hwnd, dat);
SetCapture(hwnd);
- Clist_ClearSearch(hwnd, dat);
return 0;
case VK_F2: cliBeginRenameSelection(hwnd, dat); /*SetCapture(hwnd);*/ return 0;
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 4d8e7a88c1..a185c7f40f 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -612,24 +612,22 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L pcli->pfnHideInfoTip(hwnd, dat);
KillTimer(hwnd, TIMERID_RENAME);
KillTimer(hwnd, TIMERID_INFOTIP);
- dat->szQuickSearch[0] = 0;
- {
- DWORD hitFlags;
- dat->selection = HitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, NULL, &hitFlags);
- if (hitFlags & CLCHT_ONITEMEXTRA)
- break;
- InvalidateRect(hwnd, NULL, FALSE);
- if (dat->selection != -1)
- pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
- if (hitFlags & CLCHT_ONAVATAR && cfg::dat.bDblClkAvatars) {
- CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)contact->hContact, 0);
- return TRUE;
- }
- if (hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMLABEL | CLCHT_ONITEMSPACE)) {
- UpdateWindow(hwnd);
- pcli->pfnDoSelectionDefaultAction(hwnd, dat);
- }
+ DWORD hitFlags;
+ dat->selection = HitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, NULL, &hitFlags);
+ if (hitFlags & CLCHT_ONITEMEXTRA)
+ break;
+
+ InvalidateRect(hwnd, NULL, FALSE);
+ if (dat->selection != -1)
+ pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ if (hitFlags & CLCHT_ONAVATAR && cfg::dat.bDblClkAvatars) {
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)contact->hContact, 0);
+ return TRUE;
+ }
+ if (hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMLABEL | CLCHT_ONITEMSPACE)) {
+ UpdateWindow(hwnd);
+ pcli->pfnDoSelectionDefaultAction(hwnd, dat);
}
return TRUE;
@@ -680,7 +678,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L PostMessage(GetParent(hwnd), WM_CONTEXTMENU, wParam, lParam);
return 0;
}
- if (hMenu != NULL) {
+ if (hMenu != nullptr) {
ClientToScreen(hwnd, &pt);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
DestroyMenu(hMenu);
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 2f00997c80..e11e69701a 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -48,14 +48,6 @@ void fnInitAutoRebuild(HWND hWnd) }
}
-MIR_APP_DLL(void) Clist_ClearSearch(HWND hwnd, ClcData *dat)
-{
- bool bSearchExisted = dat->szQuickSearch[0] != 0;
- dat->szQuickSearch[0] = 0;
- if (dat->bFilterSearch && bSearchExisted)
- cli.pfnSaveStateAndRebuildList(hwnd, dat);
-}
-
MIR_APP_DLL(void) Clist_Broadcast(int msg, WPARAM wParam, LPARAM lParam)
{
WindowList_Broadcast(hClcWindowList, msg, wParam, lParam);
@@ -705,12 +697,14 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case VK_END: dat->selection = cli.pfnGetGroupContentsCount(&dat->list, 1) - 1; selMoved = 1; break;
case VK_LEFT: changeGroupExpand = 1; break;
case VK_RIGHT: changeGroupExpand = 2; break;
+
case VK_RETURN:
cli.pfnDoSelectionDefaultAction(hwnd, dat);
- Clist_ClearSearch(hwnd, dat);
return 0;
+
case VK_F2: cli.pfnBeginRenameSelection(hwnd, dat); return 0;
case VK_DELETE: cli.pfnDeleteFromContactList(hwnd, dat); return 0;
+
default:
NMKEY nmkey;
nmkey.hdr.hwndFrom = hwnd;
@@ -1177,12 +1171,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
- if (!(hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMLABEL)))
- break;
-
- UpdateWindow(hwnd);
- cli.pfnDoSelectionDefaultAction(hwnd, dat);
- Clist_ClearSearch(hwnd, dat);
+
+ if (hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMLABEL)) {
+ UpdateWindow(hwnd);
+ cli.pfnDoSelectionDefaultAction(hwnd, dat);
+ }
break;
case WM_CONTEXTMENU:
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index 5e1bfec607..77c4ab601d 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -347,17 +347,23 @@ void fnSetGroupExpand(HWND hwnd, ClcData *dat, ClcGroup *group, int newState) void fnDoSelectionDefaultAction(HWND hwnd, ClcData *dat)
{
- ClcContact *contact;
-
if (dat->selection == -1)
return;
+
+ bool bSearchExisted = dat->szQuickSearch[0] != 0;
dat->szQuickSearch[0] = 0;
+
+ ClcContact *contact;
if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
return;
+
if (contact->type == CLCIT_GROUP)
cli.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
if (contact->type == CLCIT_CONTACT)
Clist_ContactDoubleClicked(contact->hContact);
+
+ if (dat->bFilterSearch && bSearchExisted)
+ cli.pfnSaveStateAndRebuildList(hwnd, dat);
}
int fnFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk)
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index db7b8fded0..d7637765fe 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -425,7 +425,6 @@ Chat_UpdateOptions @418 NONAME ?RedrawLog2@CSrmmBaseDialog@@QAEXXZ @426 NONAME
?ScrollToBottom@CSrmmBaseDialog@@UAEXXZ @427 NONAME
?UpdateNickList@CSrmmBaseDialog@@UAEXXZ @428 NONAME
-Clist_ClearSearch @429 NONAME
?onClick_BIU@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @430 NONAME
?onClick_BkColor@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @431 NONAME
?onClick_Color@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @432 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 06e3fcb09b..a158a3409b 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -425,7 +425,6 @@ Chat_UpdateOptions @418 NONAME ?RedrawLog2@CSrmmBaseDialog@@QEAAXXZ @426 NONAME
?ScrollToBottom@CSrmmBaseDialog@@UEAAXXZ @427 NONAME
?UpdateNickList@CSrmmBaseDialog@@UEAAXXZ @428 NONAME
-Clist_ClearSearch @429 NONAME
?onClick_BIU@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @430 NONAME
?onClick_BkColor@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @431 NONAME
?onClick_Color@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @432 NONAME
|