• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28240 (tree)
Time2018-06-02 16:03:58
Authorstefankueng

Log Message

high-dpi fixes for TortoiseBlame.

Change Summary

Incremental Difference

--- trunk/src/TortoiseBlame/TortoiseBlame.cpp (revision 28239)
+++ trunk/src/TortoiseBlame/TortoiseBlame.cpp (revision 28240)
@@ -28,6 +28,7 @@
2828 #include "BlameIndexColors.h"
2929 #include "../Utils/CrashReport.h"
3030 #include "../Utils/DebugOutput.h"
31+#include "../Utils/DPIAware.h"
3132
3233 #include <algorithm>
3334 #include <cctype>
@@ -1371,13 +1372,13 @@
13711372 TCHAR buf[MAX_PATH] = { 0 };
13721373 swprintf_s(buf, L"*%8d ", 88888888);
13731374 ::GetTextExtentPoint(hDC, buf, (int)wcslen(buf), &width);
1374- m_revWidth = width.cx + BLAMESPACE;
1375+ m_revWidth = width.cx + CDPIAware::Instance().ScaleX(BLAMESPACE);
13751376 blamewidth += m_revWidth;
13761377 if (ShowDate)
13771378 {
13781379 swprintf_s(buf, L"%30s", L"31.08.2001 06:24:14");
13791380 ::GetTextExtentPoint32(hDC, buf, (int)wcslen(buf), &width);
1380- m_dateWidth = width.cx + BLAMESPACE;
1381+ m_dateWidth = width.cx + CDPIAware::Instance().ScaleX(BLAMESPACE);
13811382 blamewidth += m_dateWidth;
13821383 }
13831384 if (ShowAuthor)
@@ -1389,7 +1390,7 @@
13891390 if (width.cx > maxwidth.cx)
13901391 maxwidth = width;
13911392 }
1392- m_authorWidth = maxwidth.cx + BLAMESPACE;
1393+ m_authorWidth = maxwidth.cx + CDPIAware::Instance().ScaleX(BLAMESPACE);
13931394 blamewidth += m_authorWidth;
13941395 }
13951396 if (ShowPath)
@@ -1401,7 +1402,7 @@
14011402 if (width.cx > maxwidth.cx)
14021403 maxwidth = width;
14031404 }
1404- m_pathWidth = maxwidth.cx + BLAMESPACE;
1405+ m_pathWidth = maxwidth.cx + CDPIAware::Instance().ScaleX(BLAMESPACE);
14051406 blamewidth += m_pathWidth;
14061407 }
14071408 ::SelectObject(hDC, oldfont);
@@ -1553,7 +1554,7 @@
15531554 ::SetBkColor(hDC, ::GetSysColor(COLOR_BTNFACE));
15541555
15551556 RECT edgerc = rc;
1556- edgerc.bottom = edgerc.top + HEADER_HEIGHT/2;
1557+ edgerc.bottom = edgerc.top + CDPIAware::Instance().ScaleY(HEADER_HEIGHT) /2;
15571558 DrawEdge(hDC, &edgerc, EDGE_BUMP, BF_FLAT|BF_RECT|BF_ADJUST);
15581559
15591560 // draw the path first
@@ -1567,16 +1568,16 @@
15671568 if (str2.size() >= MAX_PATH)
15681569 str2 = str2.substr(0, MAX_PATH-2);
15691570 wcscpy_s(pathbuf, str2.c_str());
1570- PathCompactPath(hDC, pathbuf, edgerc.right-edgerc.left-LOCATOR_WIDTH);
1571+ PathCompactPath(hDC, pathbuf, edgerc.right-edgerc.left- CDPIAware::Instance().ScaleX(LOCATOR_WIDTH));
15711572 }
15721573 else
15731574 {
15741575 wcscpy_s(pathbuf, szViewtitle.c_str());
1575- PathCompactPath(hDC, pathbuf, edgerc.right-edgerc.left-LOCATOR_WIDTH);
1576+ PathCompactPath(hDC, pathbuf, edgerc.right-edgerc.left- CDPIAware::Instance().ScaleX(LOCATOR_WIDTH));
15761577 }
15771578 DrawText(hDC, pathbuf, -1, &edgerc, DT_SINGLELINE|DT_VCENTER);
15781579
1579- rc.top = rc.top + HEADER_HEIGHT/2;
1580+ rc.top = rc.top + CDPIAware::Instance().ScaleY(HEADER_HEIGHT)/2;
15801581 DrawEdge(hDC, &rc, EDGE_BUMP, BF_FLAT|BF_RECT|BF_ADJUST);
15811582
15821583 RECT drawRc = rc;
@@ -1583,9 +1584,9 @@
15831584
15841585 TCHAR szText[MAX_LOADSTRING] = { 0 };
15851586 LoadString(app.hResource, IDS_HEADER_REVISION, szText, MAX_LOADSTRING);
1586- drawRc.left = LOCATOR_WIDTH;
1587+ drawRc.left = CDPIAware::Instance().ScaleX(LOCATOR_WIDTH);
15871588 DrawText(hDC, szText, -1, &drawRc, DT_SINGLELINE|DT_VCENTER);
1588- int Left = m_revWidth+LOCATOR_WIDTH;
1589+ int Left = m_revWidth+ CDPIAware::Instance().ScaleX(LOCATOR_WIDTH);
15891590 if (ShowDate)
15901591 {
15911592 LoadString(app.hResource, IDS_HEADER_DATE, szText, MAX_LOADSTRING);
@@ -2029,8 +2030,8 @@
20292030 RECT blamerc;
20302031 RECT sourcerc;
20312032 ::GetClientRect(wMain, &rc);
2032- ::SetWindowPos(wHeader, 0, rc.left, rc.top, rc.right-rc.left, HEADER_HEIGHT, 0);
2033- rc.top += HEADER_HEIGHT;
2033+ ::SetWindowPos(wHeader, 0, rc.left, rc.top, rc.right-rc.left, CDPIAware::Instance().ScaleY(HEADER_HEIGHT), 0);
2034+ rc.top += CDPIAware::Instance().ScaleY(HEADER_HEIGHT);
20342035 blamerc.left = rc.left;
20352036 blamerc.top = rc.top;
20362037 LONG w = GetBlameWidth();
@@ -2042,15 +2043,15 @@
20422043 sourcerc.right = rc.right;
20432044 if (m_colorby != COLORBYNONE)
20442045 {
2045- ::OffsetRect(&blamerc, LOCATOR_WIDTH, 0);
2046- ::OffsetRect(&sourcerc, LOCATOR_WIDTH, 0);
2047- sourcerc.right -= LOCATOR_WIDTH;
2046+ ::OffsetRect(&blamerc, CDPIAware::Instance().ScaleX(LOCATOR_WIDTH), 0);
2047+ ::OffsetRect(&sourcerc, CDPIAware::Instance().ScaleX(LOCATOR_WIDTH), 0);
2048+ sourcerc.right -= CDPIAware::Instance().ScaleX(LOCATOR_WIDTH);
20482049 }
20492050 InvalidateRect(wMain, NULL, FALSE);
20502051 ::SetWindowPos(wEditor, 0, sourcerc.left, sourcerc.top, sourcerc.right - sourcerc.left, sourcerc.bottom - sourcerc.top, 0);
20512052 ::SetWindowPos(wBlame, 0, blamerc.left, blamerc.top, blamerc.right - blamerc.left, blamerc.bottom - blamerc.top, 0);
20522053 if (m_colorby != COLORBYNONE)
2053- ::SetWindowPos(wLocator, 0, 0, blamerc.top, LOCATOR_WIDTH, blamerc.bottom - blamerc.top, SWP_SHOWWINDOW);
2054+ ::SetWindowPos(wLocator, 0, 0, blamerc.top, CDPIAware::Instance().ScaleX(LOCATOR_WIDTH), blamerc.bottom - blamerc.top, SWP_SHOWWINDOW);
20542055 else
20552056 ::ShowWindow(wLocator, SW_HIDE);
20562057 }
Show on old repository browser