瀏覽代碼

show context menu under selection if mouse is not inside of selected row

scott brogden 8 年之前
父節點
當前提交
a81ef36f21
共有 1 個文件被更改,包括 7 次插入13 次删除
  1. 7 13
      QPasteWnd.cpp

+ 7 - 13
QPasteWnd.cpp

@@ -1408,22 +1408,16 @@ void CQPasteWnd::ShowRightClickMenu()
 		}
 
 		int nItem = m_lstHeader.GetCaret();
-		CRect listRect;
-		m_lstHeader.GetWindowRect(listRect);
-		if (listRect.PtInRect(pp) == FALSE)
+
+		CRect rc;
+		m_lstHeader.GetItemRect(nItem, rc, LVIR_BOUNDS);
+		ClientToScreen(rc);
+
+		if (rc.PtInRect(pp) == FALSE)
 		{
-			CRect rc;
-			m_lstHeader.GetItemRect(nItem, rc, LVIR_BOUNDS);
-			ClientToScreen(rc);
 			pp.x = rc.left;
 			pp.y = rc.bottom;
-
-			if (listRect.PtInRect(pp) == FALSE)
-			{
-				pp.x = listRect.left;
-				pp.y = listRect.top;
-			}
-		}	
+		}
 
         theApp.m_Addins.AddPrePasteAddinsToMenu(cmSubMenu);