Przeglądaj źródła

- press and hold up/down in search box now moves selection correctly
- improvements to showing image description

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@715 595ec19a-5cb4-439b-94a8-42fb3063c22c

sabrogden 11 lat temu
rodzic
commit
9e36834e7b
3 zmienionych plików z 20 dodań i 12 usunięć
  1. 1 1
      QListCtrl.cpp
  2. 2 1
      QPasteWnd.cpp
  3. 17 10
      ToolTipEx.cpp

+ 1 - 1
QListCtrl.cpp

@@ -1028,7 +1028,7 @@ void CQListCtrl::ShowFullDescription(bool bFromAuto, bool fromNextPrev)
 				
 				CDC *pDC = GetDC();;
 
-				CBitmapHelper::GetCBitmap(&Clip, pDC, pBitMap, (rcItem.Width() * 2));
+				CBitmapHelper::GetCBitmap(&Clip, pDC, pBitMap, MAXINT);
 
 				ReleaseDC(pDC);
 

+ 2 - 1
QPasteWnd.cpp

@@ -3839,7 +3839,8 @@ LRESULT CQPasteWnd::OnUpDown(WPARAM wParam, LPARAM lParam)
     if(m_lstHeader.HandleKeyDown(wParam, lParam) == FALSE)
     {
 		MSG msg;
-		msg.lParam = lParam;
+		//Workaround for allow holding down arrow keys while in the search control
+		msg.lParam = lParam & (~0x40000000);
 		msg.wParam = wParam;
 		msg.message = WM_KEYDOWN;
 

+ 17 - 10
ToolTipEx.cpp

@@ -154,6 +154,8 @@ BOOL CToolTipEx::Show(CPoint point)
 		rect.right += CAPTION_BORDER * 2;
 		rect.bottom += CAPTION_BORDER * 2;
 
+		
+
 		CRect rcScreen;
 
 		ClientToScreen(rect);
@@ -184,26 +186,30 @@ BOOL CToolTipEx::Show(CPoint point)
 		rect.top = point.y;
 		rect.right = rect.left + lWidth;
 		rect.bottom = rect.top + lHeight;
-
-		if(rect.right > rcScreen.right)
+		
+		if (rect.right > rcScreen.right)
 		{
 			int diff = rect.right - rcScreen.right;
 
 			int newLeft = rect.left - diff;
-			if(newLeft > 0)
+			if (newLeft > rcScreen.left)
 			{
 				rect.left = newLeft;
 			}
+			else
+			{
+				rect.left = rcScreen.left;
+			}
 
 			rect.right = rcScreen.right;
 			m_reducedWindowSize = true;
 		}
-		if(rect.bottom > rcScreen.bottom)
+		if (rect.bottom > rcScreen.bottom)
 		{
 			int diff = rect.bottom - rcScreen.bottom;
 
 			int newTop = rect.top - diff;
-			if(newTop > 0)
+			if (newTop > 0)
 			{
 				rect.top = newTop;
 			}
@@ -271,7 +277,8 @@ void CToolTipEx::OnPaint()
 
 		if(CGetSetOptions::GetScaleImagesToDescWindow())
 		{
-			dc.StretchBlt(rect.left, rect.top, rect.Width(), rect.Height(), &MemDc, 0, 0, nWidth, nWidth, SRCCOPY);
+			dc.StretchBlt(rect.left, rect.top, rect.Width(), rect.Height(), &MemDc, 0, 0, nWidth, nHeight, SRCCOPY);
+			/OutputDebugString(StrF(_T("scaling image, window size %d/%d, image %d/%d\n"), min(nWidth, rect.Width()), min(nHeight, rect.Height()), nWidth, nHeight));
 		}
 		else
 		{
@@ -544,6 +551,9 @@ void CToolTipEx::SetBitmap(CBitmap *pBitmap)
     DELETE_BITMAP 
 
     m_pBitmap = pBitmap;
+
+	int nWidth = CBitmapHelper::GetCBitmapWidth(*m_pBitmap);
+	int nHeight = CBitmapHelper::GetCBitmapHeight(*m_pBitmap);
 }
 
 void CToolTipEx::OnSize(UINT nType, int cx, int cy)
@@ -555,8 +565,6 @@ void CToolTipEx::OnSize(UINT nType, int cx, int cy)
         return ;
     }
 
-	
-
     CRect cr;
     GetClientRect(cr);
     cr.DeflateRect(0, 0, 0, theApp.m_metrics.ScaleY(21));
@@ -564,8 +572,7 @@ void CToolTipEx::OnSize(UINT nType, int cx, int cy)
 
 	m_optionsButton.MoveWindow(cr.left, cr.bottom + theApp.m_metrics.ScaleY(2), theApp.m_metrics.ScaleX(17), theApp.m_metrics.ScaleY(17));
 
-	//this->Invalidate();
-
+	this->Invalidate();
 	m_DittoWindow.DoSetRegion(this);
 }