diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-27 10:50:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-27 10:50:37 +0000 |
commit | 9580ae1f0619b89d9064f89e480903103efa22e7 (patch) | |
tree | f14f172f100330fd483bc0d0418163d8ad0ed3d6 /src/modules/database | |
parent | 65d8fdb5c8c2e9572821d146a01184b95e60e966 (diff) |
fixes:
#502 (Profile manager: context menu can't be reached from the keyboard)
#579 (only 10 profiles are visible in Profile Manager)
git-svn-id: http://svn.miranda-ng.org/main/trunk@8773 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database')
-rw-r--r-- | src/modules/database/profilemanager.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index ea5b7e1a3b..a221e29a44 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -392,7 +392,7 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, ListView_InsertColumn(hwndList, 0, &col);
col.pszText = TranslateT("Driver");
- col.cx = 150;
+ col.cx = 150 - GetSystemMetrics(SM_CXVSCROLL);
ListView_InsertColumn(hwndList, 1, &col);
col.pszText = TranslateT("Size");
@@ -455,11 +455,24 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, lvht.pt.x = GET_X_LPARAM(lParam);
lvht.pt.y = GET_Y_LPARAM(lParam);
ScreenToClient(hwndList, &lvht.pt);
- if (ListView_HitTest(hwndList, &lvht) < 0)
- break;
- lvht.pt.x = GET_X_LPARAM(lParam);
- lvht.pt.y = GET_Y_LPARAM(lParam);
+ if (ListView_HitTest(hwndList, &lvht) < 0) {
+ if (lParam != -1)
+ break;
+
+ lvht.iItem = ListView_GetSelectionMark(hwndList);
+ RECT rc = { 0 };
+ if (!ListView_GetItemRect(hwndList, lvht.iItem, &rc, LVIR_LABEL))
+ break;
+
+ lvht.pt.x = rc.left;
+ lvht.pt.y = rc.bottom;
+ ClientToScreen(hwndList, &lvht.pt);
+ }
+ else {
+ lvht.pt.x = GET_X_LPARAM(lParam);
+ lvht.pt.y = GET_Y_LPARAM(lParam);
+ }
HMENU hMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_STRING, 1, TranslateT("Run"));
|