• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28237 (tree)
Time2018-06-02 15:52:20
Authorstefankueng

Log Message

high-dpi fixes for the about dialog.

Change Summary

Incremental Difference

--- trunk/src/TortoiseProc/AboutDlg.cpp (revision 28236)
+++ trunk/src/TortoiseProc/AboutDlg.cpp (revision 28237)
@@ -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) 2003-2014, 2016-2017 - TortoiseSVN
3+// Copyright (C) 2003-2014, 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
@@ -26,6 +26,7 @@
2626 #include "../../ext/sqlite/sqlite3.h"
2727 #include "../../ext/openssl/include/openssl/opensslv.h"
2828 #include "AppUtils.h"
29+#include "../Utils/DPIAware.h"
2930
3031 IMPLEMENT_DYNAMIC(CAboutDlg, CStandAloneDialog)
3132 CAboutDlg::CAboutDlg(CWnd* pParent /*=NULL*/)
@@ -90,10 +91,10 @@
9091
9192 CPictureHolder tmpPic;
9293 tmpPic.CreateFromBitmap(IDB_LOGOFLIPPED);
93- m_renderSrc.Create32BitFromPicture(&tmpPic,468,64);
94- m_renderDest.Create32BitFromPicture(&tmpPic,468,64);
94+ m_renderSrc.Create32BitFromPicture(&tmpPic, CDPIAware::Instance().ScaleX(468), CDPIAware::Instance().ScaleY(64));
95+ m_renderDest.Create32BitFromPicture(&tmpPic, CDPIAware::Instance().ScaleX(468), CDPIAware::Instance().ScaleY(64));
9596
96- m_waterEffect.Create(468,64);
97+ m_waterEffect.Create(CDPIAware::Instance().ScaleX(468), CDPIAware::Instance().ScaleY(64));
9798 SetTimer(ID_EFFECTTIMER, 40, NULL);
9899 SetTimer(ID_DROPTIMER, 1500, NULL);
99100
@@ -111,14 +112,14 @@
111112 {
112113 m_waterEffect.Render((DWORD*)m_renderSrc.GetDIBits(), (DWORD*)m_renderDest.GetDIBits());
113114 CClientDC dc(this);
114- CPoint ptOrigin(15,20);
115+ CPoint ptOrigin(CDPIAware::Instance().ScaleX(15), CDPIAware::Instance().ScaleY(20));
115116 m_renderDest.Draw(&dc,ptOrigin);
116117 }
117118 if (nIDEvent == ID_DROPTIMER)
118119 {
119120 CRect r;
120- r.left = 15;
121- r.top = 20;
121+ r.left = CDPIAware::Instance().ScaleX(15);
122+ r.top = CDPIAware::Instance().ScaleY(20);
122123 r.right = r.left + m_renderSrc.GetWidth();
123124 r.bottom = r.top + m_renderSrc.GetHeight();
124125 m_waterEffect.Blob(random(r.left,r.right), random(r.top, r.bottom), 5, 800, m_waterEffect.m_iHpage);
@@ -128,9 +129,11 @@
128129
129130 void CAboutDlg::OnMouseMove(UINT nFlags, CPoint point)
130131 {
132+ auto dpix15 = CDPIAware::Instance().ScaleX(15);
133+ auto dpiy20 = CDPIAware::Instance().ScaleY(20);
131134 CRect r;
132- r.left = 15;
133- r.top = 20;
135+ r.left = dpix15;
136+ r.top = dpiy20;
134137 r.right = r.left + m_renderSrc.GetWidth();
135138 r.bottom = r.top + m_renderSrc.GetHeight();
136139
@@ -137,13 +140,13 @@
137140 if(r.PtInRect(point) == TRUE)
138141 {
139142 // dibs are drawn upside down...
140- point.y -= 20;
141- point.y = 64-point.y;
143+ point.y -= dpiy20;
144+ point.y = CDPIAware::Instance().ScaleY(64) -point.y;
142145
143146 if (nFlags & MK_LBUTTON)
144- m_waterEffect.Blob(point.x -15,point.y,10,1600,m_waterEffect.m_iHpage);
147+ m_waterEffect.Blob(point.x - dpix15,point.y, CDPIAware::Instance().ScaleX(10),1600,m_waterEffect.m_iHpage);
145148 else
146- m_waterEffect.Blob(point.x -15,point.y,5,50,m_waterEffect.m_iHpage);
149+ m_waterEffect.Blob(point.x - dpix15,point.y, CDPIAware::Instance().ScaleX(5),50,m_waterEffect.m_iHpage);
147150
148151 }
149152
Show on old repository browser