• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28329 (tree)
Time2018-08-02 05:10:16
Authorstefankueng

Log Message

* More fixes for high-dpi monitors.
* In the repo browser, also got rid of the XOR drawing for the splitter and instead adjust the sizes directly

Change Summary

Incremental Difference

--- trunk/src/TortoiseProc/RepositoryBrowser.h (revision 28328)
+++ trunk/src/TortoiseProc/RepositoryBrowser.h (revision 28329)
@@ -181,8 +181,6 @@
181181 LRESULT OnAfterInitDialog(WPARAM /*wParam*/, LPARAM /*lParam*/);
182182 /// called to update the tree node for a specific URL
183183 LRESULT OnRefreshURL(WPARAM /*wParam*/, LPARAM lParam);
184- /// draws the bar when the tree and list control are resized
185- void DrawXorBar(CDC * pDC, int x1, int y1, int width, int height);
186184
187185 /// recursively removes all items from \c hItem on downwards.
188186 void RecursiveRemove(HTREEITEM hItem, bool bChildrenOnly = false);
@@ -283,7 +281,7 @@
283281 bool TrySVNParentPath();
284282
285283 /// resizes the control so that the divider is at position 'point'
286- void HandleDividerMove(CPoint point, bool bDraw);
284+ void HandleDividerMove(CPoint point);
287285 bool CheckoutDepthForItem( HTREEITEM hItem );
288286 void CheckTreeItem( HTREEITEM hItem, bool bCheck );
289287 void CheckTreeItemRecursive( HTREEITEM hItem, bool bCheck );
--- trunk/src/TortoiseProc/RepositoryBrowser.cpp (revision 28328)
+++ trunk/src/TortoiseProc/RepositoryBrowser.cpp (revision 28329)
@@ -53,6 +53,7 @@
5353 #include "Callback.h"
5454 #include "SVNStatus.h"
5555 #include "SmartHandle.h"
56+#include "DPIAware.h"
5657
5758
5859 #include <fstream>
@@ -451,7 +452,7 @@
451452 // the tree and the list control
452453 CRect drc(0, 0, 10, 10);
453454 MapDialogRect(&drc);
454- HandleDividerMove(CPoint(xPos + drc.right, 10), false);
455+ HandleDividerMove(CPoint(xPos + drc.right, CDPIAware::Instance().Scale(10)));
455456 }
456457 else
457458 {
@@ -985,23 +986,17 @@
985986 //same for the window coordinates - make them relative to 0,0
986987 OffsetRect(&treelist, -treelist.left, -treelist.top);
987988
988- if (point.x < treelist.left+REPOBROWSER_CTRL_MIN_WIDTH)
989- point.x = treelist.left+REPOBROWSER_CTRL_MIN_WIDTH;
990- if (point.x > treelist.right-REPOBROWSER_CTRL_MIN_WIDTH)
991- point.x = treelist.right-REPOBROWSER_CTRL_MIN_WIDTH;
989+ auto minWidth = CDPIAware::Instance().Scale(REPOBROWSER_CTRL_MIN_WIDTH);
992990
991+ if (point.x < treelist.left+minWidth)
992+ point.x = treelist.left+minWidth;
993+ if (point.x > treelist.right-minWidth)
994+ point.x = treelist.right-minWidth;
995+
993996 if ((nFlags & MK_LBUTTON) && (point.x != oldx))
994997 {
995- CDC * pDC = GetDC();
998+ HandleDividerMove(point);
996999
997- if (pDC)
998- {
999- DrawXorBar(pDC, oldx+2, treelistclient.top, 4, treelistclient.bottom-treelistclient.top-2);
1000- DrawXorBar(pDC, point.x+2, treelistclient.top, 4, treelistclient.bottom-treelistclient.top-2);
1001-
1002- ReleaseDC(pDC);
1003- }
1004-
10051000 oldx = point.x;
10061001 oldy = point.y;
10071002 }
@@ -1034,15 +1029,18 @@
10341029 //same for the window coordinates - make them relative to 0,0
10351030 OffsetRect(&treelist, -treelist.left, -treelist.top);
10361031
1037- if (point.x < treelist.left+REPOBROWSER_CTRL_MIN_WIDTH)
1032+ auto minWidth = CDPIAware::Instance().Scale(REPOBROWSER_CTRL_MIN_WIDTH);
1033+ auto divWidth = CDPIAware::Instance().Scale(3);
1034+
1035+ if (point.x < treelist.left+minWidth)
10381036 return CStandAloneDialogTmpl<CResizableDialog>::OnLButtonDown(nFlags, point);
1039- if (point.x > treelist.right-3)
1037+ if (point.x > treelist.right - divWidth)
10401038 return CStandAloneDialogTmpl<CResizableDialog>::OnLButtonDown(nFlags, point);
1041- if (point.x > treelist.right-REPOBROWSER_CTRL_MIN_WIDTH)
1042- point.x = treelist.right-REPOBROWSER_CTRL_MIN_WIDTH;
1039+ if (point.x > treelist.right-minWidth)
1040+ point.x = treelist.right-minWidth;
10431041
1044- if ((point.y < treelist.top+3) ||
1045- (point.y > treelist.bottom-3))
1042+ if ((point.y < treelist.top + divWidth) ||
1043+ (point.y > treelist.bottom - divWidth))
10461044 return CStandAloneDialogTmpl<CResizableDialog>::OnLButtonDown(nFlags, point);
10471045
10481046 bDragMode = true;
@@ -1049,10 +1047,6 @@
10491047
10501048 SetCapture();
10511049
1052- CDC * pDC = GetDC();
1053- DrawXorBar(pDC, point.x+2, treelistclient.top, 4, treelistclient.bottom-treelistclient.top-2);
1054- ReleaseDC(pDC);
1055-
10561050 oldx = point.x;
10571051 oldy = point.y;
10581052
@@ -1059,7 +1053,7 @@
10591053 CStandAloneDialogTmpl<CResizableDialog>::OnLButtonDown(nFlags, point);
10601054 }
10611055
1062-void CRepositoryBrowser::HandleDividerMove(CPoint point, bool bDraw)
1056+void CRepositoryBrowser::HandleDividerMove(CPoint point)
10631057 {
10641058 RECT rect, tree, list, treelist, treelistclient;
10651059
@@ -1074,11 +1068,13 @@
10741068 GetClientRect(&rect);
10751069 ClientToScreen(&rect);
10761070
1071+ auto minWidth = CDPIAware::Instance().Scale(REPOBROWSER_CTRL_MIN_WIDTH);
1072+
10771073 CPoint point2 = point;
1078- if (point2.x < treelist.left+REPOBROWSER_CTRL_MIN_WIDTH)
1079- point2.x = treelist.left+REPOBROWSER_CTRL_MIN_WIDTH;
1080- if (point2.x > treelist.right-REPOBROWSER_CTRL_MIN_WIDTH)
1081- point2.x = treelist.right-REPOBROWSER_CTRL_MIN_WIDTH;
1074+ if (point2.x < treelist.left+minWidth)
1075+ point2.x = treelist.left+minWidth;
1076+ if (point2.x > treelist.right-minWidth)
1077+ point2.x = treelist.right-minWidth;
10821078
10831079 point.x -= rect.left;
10841080 point.y -= treelist.top;
@@ -1085,29 +1081,23 @@
10851081
10861082 OffsetRect(&treelist, -treelist.left, -treelist.top);
10871083
1088- if (point.x < treelist.left+REPOBROWSER_CTRL_MIN_WIDTH)
1089- point.x = treelist.left+REPOBROWSER_CTRL_MIN_WIDTH;
1090- if (point.x > treelist.right-REPOBROWSER_CTRL_MIN_WIDTH)
1091- point.x = treelist.right-REPOBROWSER_CTRL_MIN_WIDTH;
1084+ if (point.x < treelist.left+minWidth)
1085+ point.x = treelist.left+minWidth;
1086+ if (point.x > treelist.right-minWidth)
1087+ point.x = treelist.right-minWidth;
10921088
1093- if (bDraw)
1094- {
1095- CDC * pDC = GetDC();
1096- DrawXorBar(pDC, oldx+2, treelistclient.top, 4, treelistclient.bottom-treelistclient.top-2);
1097- ReleaseDC(pDC);
1098- }
1099-
11001089 oldx = point.x;
11011090 oldy = point.y;
11021091
1092+ auto divWidth = CDPIAware::Instance().Scale(2);
11031093 //position the child controls
11041094 GetDlgItem(IDC_REPOTREE)->GetWindowRect(&treelist);
1105- treelist.right = point2.x - 2;
1095+ treelist.right = point2.x - divWidth;
11061096 ScreenToClient(&treelist);
11071097 RemoveAnchor(IDC_REPOTREE);
11081098 GetDlgItem(IDC_REPOTREE)->MoveWindow(&treelist);
11091099 GetDlgItem(IDC_REPOLIST)->GetWindowRect(&treelist);
1110- treelist.left = point2.x + 2;
1100+ treelist.left = point2.x + divWidth;
11111101 ScreenToClient(&treelist);
11121102 RemoveAnchor(IDC_REPOLIST);
11131103 GetDlgItem(IDC_REPOLIST)->MoveWindow(&treelist);
@@ -1123,7 +1113,7 @@
11231113
11241114 if (!m_bSparseCheckoutMode)
11251115 {
1126- HandleDividerMove(point, true);
1116+ HandleDividerMove(point);
11271117
11281118 bDragMode = false;
11291119 ReleaseCapture();
@@ -1139,31 +1129,6 @@
11391129 __super::OnCaptureChanged(pWnd);
11401130 }
11411131
1142-void CRepositoryBrowser::DrawXorBar(CDC * pDC, int x1, int y1, int width, int height)
1143-{
1144- static WORD _dotPatternBmp[8] =
1145- {
1146- 0x0055, 0x00aa, 0x0055, 0x00aa,
1147- 0x0055, 0x00aa, 0x0055, 0x00aa
1148- };
1149-
1150- HBITMAP hbm;
1151- HBRUSH hbr, hbrushOld;
1152-
1153- hbm = CreateBitmap(8, 8, 1, 1, _dotPatternBmp);
1154- hbr = CreatePatternBrush(hbm);
1155-
1156- pDC->SetBrushOrg(x1, y1);
1157- hbrushOld = (HBRUSH)pDC->SelectObject(hbr);
1158-
1159- PatBlt(pDC->GetSafeHdc(), x1, y1, width, height, PATINVERT);
1160-
1161- pDC->SelectObject(hbrushOld);
1162-
1163- DeleteObject(hbr);
1164- DeleteObject(hbm);
1165-}
1166-
11671132 bool CRepositoryBrowser::ChangeToUrl(CString& url, SVNRev& rev, bool bAlreadyChecked)
11681133 {
11691134 CWaitCursorEx wait;
--- trunk/src/TortoiseProc/CommitDlg.cpp (revision 28328)
+++ trunk/src/TortoiseProc/CommitDlg.cpp (revision 28329)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2017 - TortoiseSVN
3+// Copyright (C) 2003-2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -35,6 +35,7 @@
3535 #include "BstrSafeVector.h"
3636 #include "SmartHandle.h"
3737 #include "Hooks.h"
38+#include "DPIAware.h"
3839
3940 #ifdef _DEBUG
4041 #define new DEBUG_NEW
@@ -626,7 +627,7 @@
626627 m_History.Load(reg, L"logmsgs");
627628 }
628629
629- // Initialise the list control with the status of the files/folders below us
630+ // Initialize the list control with the status of the files/folders below us
630631 BOOL success = m_ListCtrl.GetStatus(m_pathList);
631632 m_ListCtrl.CheckIfChangelistsArePresent(false);
632633
@@ -1542,7 +1543,7 @@
15421543 m_ListCtrl.GetWindowRect(rcMiddle);
15431544 ScreenToClient(rcMiddle);
15441545 if (rcMiddle.Height() && rcMiddle.Width())
1545- m_wndSplitter.SetRange(rcTop.top+60, rcMiddle.bottom-80);
1546+ m_wndSplitter.SetRange(rcTop.top + CDPIAware::Instance().Scale(60), rcMiddle.bottom - CDPIAware::Instance().Scale(80));
15461547 }
15471548 }
15481549
@@ -1939,7 +1940,7 @@
19391940 m_wndSplitter.GetWindowRect(&rectSplitter);
19401941 ScreenToClient(&rectSplitter);
19411942 int delta = yPos - rectSplitter.top;
1942- if ((rcLogMsg.bottom + delta > rcLogMsg.top)&&(rcLogMsg.bottom + delta < rcFileList.bottom - 30))
1943+ if ((rcLogMsg.bottom + delta > rcLogMsg.top)&&(rcLogMsg.bottom + delta < rcFileList.bottom - CDPIAware::Instance().Scale(30)))
19431944 {
19441945 m_wndSplitter.SetWindowPos(NULL, rectSplitter.left, yPos, 0, 0, SWP_NOSIZE);
19451946 DoSize(delta);
Show on old repository browser