• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28203 (tree)
Time2018-04-21 21:36:38
Authorstefankueng

Log Message

Merged revision(s) r28191, r28195, r28196, r28197, r28198, r28199, r28200, r28201, r28202 from trunk:
* doc: compress images losslessly.
* use the correct dialog titles and command button texts when handling different kinds of conflicts.
* extend the label to make room for translated strings.
* mark the 1.9.8 version in the changelog as unreleased.
* When shelving from the status list control, always show the UI because we need a name to store the shelve.
* Return early in case of an error, do not try to access the invalid hash.
* use the improved DPIAware class from the sktoolslib.
* Make the toolbar icons size up for high dpi monitors.
* use the new bigger icons from CommitMonitor.

Change Summary

Incremental Difference

--- branches/1.10.x/src/TortoiseMerge/BaseView.cpp (revision 28202)
+++ branches/1.10.x/src/TortoiseMerge/BaseView.cpp (revision 28203)
@@ -28,7 +28,7 @@
2828 #include "GotoLineDlg.h"
2929 #include "EncodingDlg.h"
3030 #include "EditorConfigWrapper.h"
31-#include "DpiScale.h"
31+#include "DPIAware.h"
3232
3333 // Note about lines:
3434 // We use three different kind of lines here:
@@ -1644,7 +1644,6 @@
16441644 }
16451645 else
16461646 {
1647- CDpiScale dpi(pDC->GetSafeHdc());
16481647 CPen pen(PS_SOLID, 0, m_WhiteSpaceFg);
16491648 CPen * oldpen = pDC->SelectObject(&pen);
16501649 int yMiddle = origin.y + rc.Height()/2;
@@ -1656,10 +1655,10 @@
16561655 {
16571656 // multiline
16581657 bMultiline = true;
1659- pDC->MoveTo(origin.x, yMiddle-dpi.ScaleY(2));
1660- pDC->LineTo(origin.x+GetCharWidth()-dpi.ScaleX(1), yMiddle-dpi.ScaleY(2));
1661- pDC->LineTo(origin.x+GetCharWidth()-dpi.ScaleX(1), yMiddle+dpi.ScaleY(2));
1662- pDC->LineTo(origin.x, yMiddle+dpi.ScaleY(2));
1658+ pDC->MoveTo(origin.x, yMiddle- CDPIAware::Instance().ScaleY(2));
1659+ pDC->LineTo(origin.x+GetCharWidth()-CDPIAware::Instance().ScaleX(1), yMiddle-CDPIAware::Instance().ScaleY(2));
1660+ pDC->LineTo(origin.x+GetCharWidth()-CDPIAware::Instance().ScaleX(1), yMiddle+CDPIAware::Instance().ScaleY(2));
1661+ pDC->LineTo(origin.x, yMiddle+ CDPIAware::Instance().ScaleY(2));
16631662 }
16641663 else if (GetLineLength(nLineIndex) == 0)
16651664 bMultiline = true;
@@ -1674,32 +1673,32 @@
16741673 case EOL_AUTOLINE:
16751674 case EOL_CRLF:
16761675 // arrow from top to middle+2, then left
1677- pDC->MoveTo(origin.x+GetCharWidth()-dpi.ScaleX(1), rc.top+dpi.ScaleY(1));
1678- pDC->LineTo(origin.x+GetCharWidth()-dpi.ScaleX(1), yMiddle);
1676+ pDC->MoveTo(origin.x+GetCharWidth()-CDPIAware::Instance().ScaleX(1), rc.top+ CDPIAware::Instance().ScaleY(1));
1677+ pDC->LineTo(origin.x+GetCharWidth()-CDPIAware::Instance().ScaleX(1), yMiddle);
16791678 case EOL_CR:
16801679 // arrow from right to left
1681- pDC->MoveTo(origin.x+GetCharWidth()-dpi.ScaleX(1), yMiddle);
1680+ pDC->MoveTo(origin.x+GetCharWidth()-CDPIAware::Instance().ScaleX(1), yMiddle);
16821681 pDC->LineTo(origin.x, yMiddle);
1683- pDC->LineTo(origin.x+dpi.ScaleX(4), yMiddle+dpi.ScaleY(4));
1682+ pDC->LineTo(origin.x+CDPIAware::Instance().ScaleX(4), yMiddle+CDPIAware::Instance().ScaleY(4));
16841683 pDC->MoveTo(origin.x, yMiddle);
1685- pDC->LineTo(origin.x+dpi.ScaleX(4), yMiddle-dpi.ScaleY(4));
1684+ pDC->LineTo(origin.x+CDPIAware::Instance().ScaleX(4), yMiddle-CDPIAware::Instance().ScaleY(4));
16861685 break;
16871686 case EOL_LFCR:
16881687 // from right-upper to left then down
1689- pDC->MoveTo(origin.x+GetCharWidth()-dpi.ScaleX(1), yMiddle-dpi.ScaleY(2));
1690- pDC->LineTo(xMiddle, yMiddle-dpi.ScaleY(2));
1691- pDC->LineTo(xMiddle, rc.bottom-dpi.ScaleY(1));
1692- pDC->LineTo(xMiddle+dpi.ScaleX(4), rc.bottom-dpi.ScaleY(5));
1693- pDC->MoveTo(xMiddle, rc.bottom-dpi.ScaleY(1));
1694- pDC->LineTo(xMiddle-dpi.ScaleX(4), rc.bottom-dpi.ScaleY(5));
1688+ pDC->MoveTo(origin.x+GetCharWidth()-CDPIAware::Instance().ScaleX(1), yMiddle-CDPIAware::Instance().ScaleY(2));
1689+ pDC->LineTo(xMiddle, yMiddle-CDPIAware::Instance().ScaleY(2));
1690+ pDC->LineTo(xMiddle, rc.bottom-CDPIAware::Instance().ScaleY(1));
1691+ pDC->LineTo(xMiddle+CDPIAware::Instance().ScaleX(4), rc.bottom-CDPIAware::Instance().ScaleY(5));
1692+ pDC->MoveTo(xMiddle, rc.bottom-CDPIAware::Instance().ScaleY(1));
1693+ pDC->LineTo(xMiddle-CDPIAware::Instance().ScaleX(4), rc.bottom-CDPIAware::Instance().ScaleY(5));
16951694 break;
16961695 case EOL_LF:
16971696 // arrow from top to bottom
16981697 pDC->MoveTo(xMiddle, rc.top);
1699- pDC->LineTo(xMiddle, rc.bottom-dpi.ScaleY(1));
1700- pDC->LineTo(xMiddle+dpi.ScaleX(4), rc.bottom-dpi.ScaleY(5));
1701- pDC->MoveTo(xMiddle, rc.bottom-dpi.ScaleY(1));
1702- pDC->LineTo(xMiddle-dpi.ScaleX(4), rc.bottom-dpi.ScaleY(5));
1698+ pDC->LineTo(xMiddle, rc.bottom-CDPIAware::Instance().ScaleY(1));
1699+ pDC->LineTo(xMiddle+CDPIAware::Instance().ScaleX(4), rc.bottom-CDPIAware::Instance().ScaleY(5));
1700+ pDC->MoveTo(xMiddle, rc.bottom-CDPIAware::Instance().ScaleY(1));
1701+ pDC->LineTo(xMiddle-CDPIAware::Instance().ScaleX(4), rc.bottom-CDPIAware::Instance().ScaleY(5));
17031702 break;
17041703 case EOL_FF: // Form Feed, U+000C
17051704 case EOL_NEL: // Next Line, U+0085
@@ -2054,7 +2053,6 @@
20542053 int y = rc.top + (rc.bottom-rc.top)/2;
20552054 xpos -= m_nOffsetChar * GetCharWidth();
20562055
2057- CDpiScale dpi(pDC->GetSafeHdc());
20582056 CPen pen(PS_SOLID, 0, m_WhiteSpaceFg);
20592057 while (*pszChars)
20602058 {
@@ -2072,11 +2070,11 @@
20722070 if ((xposreal > 0) || (nSpaces > 0))
20732071 {
20742072 CPen * oldPen = pDC->SelectObject(&pen);
2075- pDC->MoveTo(xposreal + rc.left + dpi.ScaleX(2), y);
2076- pDC->LineTo((xpos + nSpaces * GetCharWidth()) + rc.left - dpi.ScaleX(2), y);
2077- pDC->LineTo((xpos + nSpaces * GetCharWidth()) + rc.left - dpi.ScaleX(6), y - dpi.ScaleY(4));
2078- pDC->MoveTo((xpos + nSpaces * GetCharWidth()) + rc.left - dpi.ScaleX(2), y);
2079- pDC->LineTo((xpos + nSpaces * GetCharWidth()) + rc.left - dpi.ScaleX(6), y + dpi.ScaleY(4));
2073+ pDC->MoveTo(xposreal + rc.left + CDPIAware::Instance().ScaleX(2), y);
2074+ pDC->LineTo((xpos + nSpaces * GetCharWidth()) + rc.left - CDPIAware::Instance().ScaleX(2), y);
2075+ pDC->LineTo((xpos + nSpaces * GetCharWidth()) + rc.left - CDPIAware::Instance().ScaleX(6), y - CDPIAware::Instance().ScaleY(4));
2076+ pDC->MoveTo((xpos + nSpaces * GetCharWidth()) + rc.left - CDPIAware::Instance().ScaleX(2), y);
2077+ pDC->LineTo((xpos + nSpaces * GetCharWidth()) + rc.left - CDPIAware::Instance().ScaleX(6), y + CDPIAware::Instance().ScaleY(4));
20802078 pDC->SelectObject(oldPen);
20812079 }
20822080 }
@@ -2090,8 +2088,8 @@
20902088 pLastSpace = pszChars + 1;
20912089 if (xpos >= 0)
20922090 {
2093- const int cxWhitespace = dpi.ScaleX(2);
2094- const int cyWhitespace = dpi.ScaleY(2);
2091+ const int cxWhitespace = CDPIAware::Instance().ScaleX(2);
2092+ const int cyWhitespace = CDPIAware::Instance().ScaleY(2);
20952093 // draw 2-logical pixel rectangle, like Scintilla editor.
20962094 pDC->FillSolidRect(xpos + rc.left + GetCharWidth() / 2 - cxWhitespace/2, y,
20972095 cxWhitespace, cyWhitespace, m_WhiteSpaceFg);
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
--- branches/1.10.x/src/TortoiseProc/TextConflictEditorDlg.cpp (revision 28202)
+++ branches/1.10.x/src/TortoiseProc/TextConflictEditorDlg.cpp (revision 28203)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2016-2017 - TortoiseSVN
3+// Copyright (C) 2016-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
@@ -159,7 +159,7 @@
159159 {
160160 auto path = m_conflictInfo->GetPath().GetFileOrDirectoryName();
161161 CString sDialogTitle;
162- sDialogTitle.LoadString(IDS_PROC_EDIT_TREE_CONFLICTS);
162+ sDialogTitle.LoadString(IDS_PROC_EDIT_TEXT_CONFLICTS);
163163 sDialogTitle = CCommonAppUtils::FormatWindowTitle(path, sDialogTitle);
164164
165165 if (!m_conflictInfo->GetTextResolutionOptions(m_options))
@@ -185,7 +185,7 @@
185185 AddCommandButton(buttonID, optLabel + L"\n" + optDescription);
186186 }
187187
188- AddCommandButton(1000, CString(MAKEINTRESOURCE(IDS_EDITCONFLICT_PROP_EDITCMD)));
188+ AddCommandButton(1000, CString(MAKEINTRESOURCE(IDS_EDITCONFLICT_TEXT_EDITCMD)));
189189
190190 int button;
191191 TASKDIALOGCONFIG taskConfig = { 0 };
--- branches/1.10.x/src/TortoiseProc/PropConflictEditorDlg.cpp (revision 28202)
+++ branches/1.10.x/src/TortoiseProc/PropConflictEditorDlg.cpp (revision 28203)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2016-2017 - TortoiseSVN
3+// Copyright (C) 2016-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
@@ -160,7 +160,7 @@
160160 {
161161 auto path = m_conflictInfo->GetPath().GetFileOrDirectoryName();
162162 CString sDialogTitle;
163- sDialogTitle.LoadString(IDS_PROC_EDIT_TREE_CONFLICTS);
163+ sDialogTitle.LoadString(IDS_PROC_EDIT_PROP_CONFLICTS);
164164 sDialogTitle = CCommonAppUtils::FormatWindowTitle(path, sDialogTitle);
165165
166166 if (!m_conflictInfo->GetPropResolutionOptions(m_options))
--- branches/1.10.x/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28202)
+++ branches/1.10.x/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28203)
@@ -64,6 +64,7 @@
6464 #include "RenameDlg.h"
6565 #include "..\..\ext\snarl\SnarlInterface.h"
6666 #include "ToastNotifications.h"
67+#include "DPIAware.h"
6768 #include <tlhelp32.h>
6869 #include <shlwapi.h>
6970 #include <fstream>
@@ -7729,12 +7730,14 @@
77297730 #define MONITORMODE_TOOLBARBUTTONCOUNT 10
77307731 TBBUTTON tbb[MONITORMODE_TOOLBARBUTTONCOUNT] = { 0 };
77317732 // create an image list containing the icons for the toolbar
7732- if (!m_toolbarImages.Create(24, 24, ILC_COLOR32 | ILC_MASK, MONITORMODE_TOOLBARBUTTONCOUNT, 4))
7733+ const int iconSizeX = int(24 * CDPIAware::Instance().ScaleFactorX());
7734+ const int iconSizeY = int(24 * CDPIAware::Instance().ScaleFactorX());
7735+ if (!m_toolbarImages.Create(iconSizeX, iconSizeY, ILC_COLOR32 | ILC_MASK, MONITORMODE_TOOLBARBUTTONCOUNT, 4))
77337736 return false;
77347737 auto iString = ::SendMessage(m_hwndToolbar, TB_ADDSTRING,
77357738 (WPARAM)AfxGetResourceHandle(), (LPARAM)IDS_MONITOR_TOOLBARTEXTS);
77367739 int index = 0;
7737- HICON hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_GETALL, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7740+ HICON hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_GETALL, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77387741 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77397742 tbb[index].idCommand = ID_LOGDLG_MONITOR_CHECKREPOSITORIESNOW;
77407743 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
@@ -7749,7 +7752,7 @@
77497752 tbb[index].dwData = 0;
77507753 tbb[index++].iString = 0;
77517754
7752- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_ADD, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7755+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_ADD, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77537756 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77547757 tbb[index].idCommand = ID_LOGDLG_MONITOR_ADDPROJECT;
77557758 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
@@ -7757,7 +7760,7 @@
77577760 tbb[index].dwData = 0;
77587761 tbb[index++].iString = iString++;
77597762
7760- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_EDIT, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7763+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_EDIT, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77617764 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77627765 tbb[index].idCommand = ID_LOGDLG_MONITOR_EDIT;
77637766 tbb[index].fsState = BTNS_SHOWTEXT;
@@ -7765,7 +7768,7 @@
77657768 tbb[index].dwData = 0;
77667769 tbb[index++].iString = iString++;
77677770
7768- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_REMOVE, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7771+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_REMOVE, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77697772 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77707773 tbb[index].idCommand = ID_LOGDLG_MONITOR_REMOVE;
77717774 tbb[index].fsState = BTNS_SHOWTEXT;
@@ -7780,7 +7783,7 @@
77807783 tbb[index].dwData = 0;
77817784 tbb[index++].iString = 0;
77827785
7783- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_MARKALLASREAD, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7786+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_MARKALLASREAD, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77847787 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77857788 tbb[index].idCommand = ID_MISC_MARKALLASREAD;
77867789 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
@@ -7788,7 +7791,7 @@
77887791 tbb[index].dwData = 0;
77897792 tbb[index++].iString = iString++;
77907793
7791- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_UPDATE, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7794+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_UPDATE, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77927795 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77937796 tbb[index].idCommand = ID_MISC_UPDATE;
77947797 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
@@ -7803,7 +7806,7 @@
78037806 tbb[index].dwData = 0;
78047807 tbb[index++].iString = 0;
78057808
7806- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_OPTIONS, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7809+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_OPTIONS, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
78077810 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
78087811 tbb[index].idCommand = ID_MISC_OPTIONS;
78097812 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
--- branches/1.10.x/src/Utils/DpiScale.h (revision 28202)
+++ branches/1.10.x/src/Utils/DpiScale.h (revision 28203)
@@ -1,43 +0,0 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
2-
3-// Copyright (C) 2017 - TortoiseSVN
4-
5-// This program is free software; you can redistribute it and/or
6-// modify it under the terms of the GNU General Public License
7-// as published by the Free Software Foundation; either version 2
8-// of the License, or (at your option) any later version.
9-
10-// This program is distributed in the hope that it will be useful,
11-// but WITHOUT ANY WARRANTY; without even the implied warranty of
12-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-// GNU General Public License for more details.
14-
15-// You should have received a copy of the GNU General Public License
16-// along with this program; if not, write to the Free Software Foundation,
17-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18-//
19-#pragma once
20-
21-class CDpiScale
22-{
23-public:
24- CDpiScale(HDC hdc)
25- {
26- m_cxScale = GetDeviceCaps(hdc, LOGPIXELSX);
27- m_cyScale = GetDeviceCaps(hdc, LOGPIXELSY);
28- }
29-
30- int ScaleX(int x) const
31- {
32- return MulDiv(x, m_cxScale, 96);
33- }
34-
35- int ScaleY(int y) const
36- {
37- return MulDiv(y, m_cyScale, 96);
38- }
39-
40-private:
41- int m_cxScale;
42- int m_cyScale;
43-};
--- branches/1.10.x/src/Utils/DPIAware.h (revision 0)
+++ branches/1.10.x/src/Utils/DPIAware.h (revision 28203)
@@ -0,0 +1,132 @@
1+// TortoiseSVN - a Windows shell extension for easy version control
2+
3+// Copyright (C) 2018 - TortoiseSVN
4+
5+// This program is free software; you can redistribute it and/or
6+// modify it under the terms of the GNU General Public License
7+// as published by the Free Software Foundation; either version 2
8+// of the License, or (at your option) any later version.
9+
10+// This program is distributed in the hope that it will be useful,
11+// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+// GNU General Public License for more details.
14+
15+// You should have received a copy of the GNU General Public License
16+// along with this program; if not, write to the Free Software Foundation,
17+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18+//
19+class CDPIAware
20+{
21+private:
22+ CDPIAware() : m_fInitialized(false), m_dpiX(96), m_dpiY(96) {}
23+ ~CDPIAware() {}
24+public:
25+ static CDPIAware& Instance()
26+ {
27+ static CDPIAware instance;
28+ return instance;
29+ }
30+
31+ // Get screen DPI.
32+ int GetDPIX() { _Init(); return m_dpiX; }
33+ int GetDPIY() { _Init(); return m_dpiY; }
34+
35+ // Convert between raw pixels and relative pixels.
36+ int ScaleX(int x) { _Init(); return MulDiv(x, m_dpiX, 96); }
37+ int ScaleY(int y) { _Init(); return MulDiv(y, m_dpiY, 96); }
38+ float ScaleFactorX() { _Init(); return m_dpiX / 96.0f; }
39+ float ScaleFactorY() { _Init(); return m_dpiY / 96.0f; }
40+ int UnscaleX(int x) { _Init(); return MulDiv(x, 96, m_dpiX); }
41+ int UnscaleY(int y) { _Init(); return MulDiv(y, 96, m_dpiY); }
42+
43+ // Determine the screen dimensions in relative pixels.
44+ int ScaledScreenWidth() { return _ScaledSystemMetricX(SM_CXSCREEN); }
45+ int ScaledScreenHeight() { return _ScaledSystemMetricY(SM_CYSCREEN); }
46+
47+ // Scale rectangle from raw pixels to relative pixels.
48+ void ScaleRect(__inout RECT *pRect)
49+ {
50+ pRect->left = ScaleX(pRect->left);
51+ pRect->right = ScaleX(pRect->right);
52+ pRect->top = ScaleY(pRect->top);
53+ pRect->bottom = ScaleY(pRect->bottom);
54+ }
55+
56+ // Scale Point from raw pixels to relative pixels.
57+ void ScalePoint(__inout POINT *pPoint)
58+ {
59+ pPoint->x = ScaleX(pPoint->x);
60+ pPoint->y = ScaleY(pPoint->y);
61+ }
62+
63+ // Scale Size from raw pixels to relative pixels.
64+ void ScaleSize(__inout SIZE *pSize)
65+ {
66+ pSize->cx = ScaleX(pSize->cx);
67+ pSize->cy = ScaleY(pSize->cy);
68+ }
69+
70+ // Determine if screen resolution meets minimum requirements in relative pixels.
71+ bool IsResolutionAtLeast(int cxMin, int cyMin)
72+ {
73+ return (ScaledScreenWidth() >= cxMin) && (ScaledScreenHeight() >= cyMin);
74+ }
75+
76+ // Convert a point size (1/72 of an inch) to raw pixels.
77+ int PointsToPixels(int pt) { return MulDiv(pt, m_dpiY, 72); }
78+
79+ // Invalidate any cached metrics.
80+ void Invalidate() { m_fInitialized = false; }
81+
82+private:
83+
84+ // This function initializes the CDPIAware Class
85+ void _Init()
86+ {
87+ if (!m_fInitialized)
88+ {
89+ HDC hdc = GetDC(nullptr);
90+ if (hdc)
91+ {
92+ // Initialize the DPI member variable
93+ // This will correspond to the DPI setting
94+ // With all Windows OS's to date the X and Y DPI will be identical
95+ m_dpiX = GetDeviceCaps(hdc, LOGPIXELSX);
96+ m_dpiY = GetDeviceCaps(hdc, LOGPIXELSY);
97+ ReleaseDC(nullptr, hdc);
98+ }
99+ m_fInitialized = true;
100+ }
101+ }
102+
103+ // This returns a 96-DPI scaled-down equivalent value for nIndex
104+ // For example, the value 120 at 120 DPI setting gets scaled down to 96
105+ // X and Y versions are provided, though to date all Windows OS releases
106+ // have equal X and Y scale values
107+ int _ScaledSystemMetricX(int nIndex)
108+ {
109+ _Init();
110+ return MulDiv(GetSystemMetrics(nIndex), 96, m_dpiX);
111+ }
112+
113+ // This returns a 96-DPI scaled-down equivalent value for nIndex
114+ // For example, the value 120 at 120 DPI setting gets scaled down to 96
115+ // X and Y versions are provided, though to date all Windows OS releases
116+ // have equal X and Y scale values
117+ int _ScaledSystemMetricY(int nIndex)
118+ {
119+ _Init();
120+ return MulDiv(GetSystemMetrics(nIndex), 96, m_dpiY);
121+ }
122+
123+private:
124+
125+ // Member variable indicating whether the class has been initialized
126+ bool m_fInitialized;
127+
128+ // X and Y DPI values are provided, though to date all
129+ // Windows OS releases have equal X and Y scale values
130+ int m_dpiX;
131+ int m_dpiY;
132+};
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- branches/1.10.x/src/Changelog.txt (revision 28202)
+++ branches/1.10.x/src/Changelog.txt (revision 28203)
@@ -1,4 +1,18 @@
1-Version 1.9.8
1+Version 1.10.1
2+- BUG: Wrong texts in conflict resolving
3+ dialogs. (Stefan)
4+- BUG: Shelving from TSVN dialogs returned
5+ an error. (Stefan)
6+- BUG: Crash when trying to unshelve from
7+ an outdated or corrupted working copy. (Stefan)
8+- CHG: Improved project monitor toolbar for
9+ high dpi monitors. (Stefan)
10+
11+Version 1.10.0
12+See the release notes here:
13+http://tortoisesvn.net/tsvn_1.10_releasenotes.html
14+
15+Version 1.9.8 (unreleased)
216 - BUG: GDI leak in repobrowser. (Stefan)
317 - BUG: Endless loop in vendor-branch. (Stefan)
418 - CHG: New line margin icons and minor high dpi refinements
--- branches/1.10.x/src/SVN/SVNStatusListCtrl.cpp (revision 28202)
+++ branches/1.10.x/src/SVN/SVNStatusListCtrl.cpp (revision 28203)
@@ -4081,7 +4081,7 @@
40814081 CString sTempFile = CTempFiles::Instance().GetTempFilePath(false).GetWinPathString();
40824082 targetList.WriteToFile(sTempFile, false);
40834083 CString sCmd;
4084- sCmd.Format(L"/command:shelve /pathfile:\"%s\" /deletepathfile /noui", (LPCTSTR)sTempFile);
4084+ sCmd.Format(L"/command:shelve /pathfile:\"%s\" /deletepathfile", (LPCTSTR)sTempFile);
40854085 if (GetAsyncKeyState(VK_SHIFT) & 0x8000)
40864086 {
40874087 sCmd += L" /showoptions";
--- branches/1.10.x/src/SVN/SVN.cpp (revision 28202)
+++ branches/1.10.x/src/SVN/SVN.cpp (revision 28203)
@@ -262,6 +262,9 @@
262262 subpool, subpool),
263263 NULL
264264 );
265+ if (Err)
266+ return false;
267+
265268 apr_hash_index_t *hi;
266269 for (hi = apr_hash_first(subpool, names_hash); hi; hi = apr_hash_next(hi))
267270 {
@@ -270,7 +273,7 @@
270273 }
271274 std::sort(Names.begin(), Names.end());
272275
273- return (Err == NULL);
276+ return (Err == nullptr);
274277 }
275278
276279 bool SVN::Checkout(const CTSVNPath& moduleName, const CTSVNPath& destPath, const SVNRev& pegrev,
Show on old repository browser