• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28305 (tree)
Time2018-07-21 15:20:23
Authorstefankueng

Log Message

high-dpi fixes for TortoiseIDiff.
Note: the project was marked dpi-aware in r28303

Change Summary

Incremental Difference

--- trunk/src/TortoiseIDiff/MainWindow.cpp (revision 28304)
+++ trunk/src/TortoiseIDiff/MainWindow.cpp (revision 28305)
@@ -51,7 +51,7 @@
5151 wcx.hCursor = LoadCursor(nullptr, IDC_SIZEWE);
5252 ResString clsname(hResource, IDS_APP_TITLE);
5353 wcx.lpszClassName = clsname;
54- wcx.hIcon = LoadIconEx(hResource, MAKEINTRESOURCE(IDI_TORTOISEIDIFF));
54+ wcx.hIcon = LoadIconEx(hResource, MAKEINTRESOURCE(IDI_TORTOISEIDIFF), GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
5555 wcx.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
5656 if (selectionPaths.empty())
5757 wcx.lpszMenuName = MAKEINTRESOURCE(IDC_TORTOISEIDIFF);
@@ -74,6 +74,7 @@
7474 RECT tbRect;
7575 if (!clientrect)
7676 return;
77+ const auto splitter_border = CDPIAware::Instance().Scale(SPLITTER_BORDER);
7778 SendMessage(hwndTB, TB_AUTOSIZE, 0, 0);
7879 GetWindowRect(hwndTB, &tbRect);
7980 LONG tbHeight = tbRect.bottom-tbRect.top-1;
@@ -93,9 +94,9 @@
9394 child.left = clientrect->left;
9495 child.top = clientrect->top+tbHeight;
9596 child.right = clientrect->right;
96- child.bottom = nSplitterPos-(SPLITTER_BORDER/2);
97+ child.bottom = nSplitterPos - (splitter_border / 2);
9798 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow1, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
98- child.top = nSplitterPos+(SPLITTER_BORDER/2);
99+ child.top = nSplitterPos + (splitter_border / 2);
99100 child.bottom = clientrect->bottom;
100101 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow2, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
101102 }
@@ -106,12 +107,12 @@
106107 child.left = clientrect->left;
107108 child.top = clientrect->top+tbHeight;
108109 child.right = clientrect->right;
109- child.bottom = nSplitterPos-(SPLITTER_BORDER/2);
110+ child.bottom = nSplitterPos - (splitter_border / 2);
110111 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow1, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
111- child.top = nSplitterPos+(SPLITTER_BORDER/2);
112- child.bottom = nSplitterPos2-(SPLITTER_BORDER/2);
112+ child.top = nSplitterPos + (splitter_border / 2);
113+ child.bottom = nSplitterPos2 - (splitter_border / 2);
113114 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow2, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
114- child.top = nSplitterPos2+(SPLITTER_BORDER/2);
115+ child.top = nSplitterPos2 + (splitter_border / 2);
115116 child.bottom = clientrect->bottom;
116117 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow3, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
117118 }
@@ -124,10 +125,10 @@
124125 RECT child;
125126 child.left = clientrect->left;
126127 child.top = clientrect->top+tbHeight;
127- child.right = nSplitterPos-(SPLITTER_BORDER/2);
128+ child.right = nSplitterPos - (splitter_border / 2);
128129 child.bottom = clientrect->bottom;
129130 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow1, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
130- child.left = nSplitterPos+(SPLITTER_BORDER/2);
131+ child.left = nSplitterPos + (splitter_border / 2);
131132 child.right = clientrect->right;
132133 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow2, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
133134 }
@@ -137,13 +138,13 @@
137138 RECT child;
138139 child.left = clientrect->left;
139140 child.top = clientrect->top+tbHeight;
140- child.right = nSplitterPos-(SPLITTER_BORDER/2);
141+ child.right = nSplitterPos - (splitter_border / 2);
141142 child.bottom = clientrect->bottom;
142143 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow1, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
143- child.left = nSplitterPos+(SPLITTER_BORDER/2);
144- child.right = nSplitterPos2-(SPLITTER_BORDER/2);
144+ child.left = nSplitterPos + (splitter_border / 2);
145+ child.right = nSplitterPos2 - (splitter_border / 2);
145146 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow2, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
146- child.left = nSplitterPos2+(SPLITTER_BORDER/2);
147+ child.left = nSplitterPos2 + (splitter_border / 2);
147148 child.right = clientrect->right;
148149 if (hdwp) hdwp = DeferWindowPos(hdwp, picWindow3, nullptr, child.left, child.top, child.right - child.left, child.bottom - child.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
149150 }
@@ -883,6 +884,9 @@
883884 if (bDragMode == FALSE)
884885 return 0;
885886
887+ const auto bordersm = CDPIAware::Instance().Scale(2);
888+ const auto borderl = CDPIAware::Instance().Scale(4);
889+
886890 GetClientRect(hwnd, &clientrect);
887891 GetWindowRect(hwnd, &rect);
888892 POINT zero = {0,0};
@@ -897,18 +901,18 @@
897901
898902 if (pt.x < 0)
899903 pt.x = 0;
900- if (pt.x > rect.right-4)
901- pt.x = rect.right-4;
904+ if (pt.x > rect.right - borderl)
905+ pt.x = rect.right - borderl;
902906 if (pt.y < 0)
903907 pt.y = 0;
904- if (pt.y > rect.bottom-4)
905- pt.y = rect.bottom-4;
908+ if (pt.y > rect.bottom - borderl)
909+ pt.y = rect.bottom - borderl;
906910
907911 hdc = GetWindowDC(hwnd);
908912 if (bVertical)
909- DrawXorBar(hdc, clientrect.left, oldy+2, clientrect.right-clientrect.left-2, 4);
913+ DrawXorBar(hdc, clientrect.left, oldy + bordersm, clientrect.right - clientrect.left - bordersm, borderl);
910914 else
911- DrawXorBar(hdc, oldx+2, clientrect.top, 4, clientrect.bottom-clientrect.top-2);
915+ DrawXorBar(hdc, oldx + bordersm, clientrect.top, borderl, clientrect.bottom - clientrect.top - bordersm);
912916 ReleaseDC(hwnd, hdc);
913917
914918 oldx = pt.x;
@@ -987,6 +991,9 @@
987991 if (bDragMode == FALSE)
988992 return 0;
989993
994+ const auto bordersm = CDPIAware::Instance().Scale(2);
995+ const auto borderl = CDPIAware::Instance().Scale(4);
996+
990997 pt.x = (short)LOWORD(lParam); // horizontal position of cursor
991998 pt.y = (short)HIWORD(lParam);
992999
@@ -1007,12 +1014,12 @@
10071014
10081015 if (pt.x < 0)
10091016 pt.x = 0;
1010- if (pt.x > rect.right-4)
1011- pt.x = rect.right-4;
1017+ if (pt.x > rect.right - borderl)
1018+ pt.x = rect.right - borderl;
10121019 if (pt.y < 0)
10131020 pt.y = 0;
1014- if (pt.y > rect.bottom-4)
1015- pt.y = rect.bottom-4;
1021+ if (pt.y > rect.bottom - borderl)
1022+ pt.y = rect.bottom - borderl;
10161023
10171024 if ((wParam & MK_LBUTTON) && ((bVertical && (pt.y != oldy)) || (!bVertical && (pt.x != oldx))))
10181025 {
@@ -1020,13 +1027,13 @@
10201027
10211028 if (bVertical)
10221029 {
1023- DrawXorBar(hdc, clientrect.left, oldy+2, clientrect.right-clientrect.left-2, 4);
1024- DrawXorBar(hdc, clientrect.left, pt.y+2, clientrect.right-clientrect.left-2, 4);
1030+ DrawXorBar(hdc, clientrect.left, oldy + bordersm, clientrect.right - clientrect.left - bordersm, borderl);
1031+ DrawXorBar(hdc, clientrect.left, pt.y + bordersm, clientrect.right - clientrect.left - bordersm, borderl);
10251032 }
10261033 else
10271034 {
1028- DrawXorBar(hdc, oldx+2, clientrect.top, 4, clientrect.bottom-clientrect.top-2);
1029- DrawXorBar(hdc, pt.x+2, clientrect.top, 4, clientrect.bottom-clientrect.top-2);
1035+ DrawXorBar(hdc, oldx + bordersm, clientrect.top, borderl, clientrect.bottom - clientrect.top - bordersm);
1036+ DrawXorBar(hdc, pt.x + bordersm, clientrect.top, borderl, clientrect.bottom - clientrect.top - bordersm);
10301037 }
10311038
10321039 ReleaseDC(hwnd, hdc);
--- trunk/src/TortoiseIDiff/PicWindow.cpp (revision 28304)
+++ trunk/src/TortoiseIDiff/PicWindow.cpp (revision 28305)
@@ -42,7 +42,7 @@
4242 wcx.hInstance = hResource;
4343 wcx.hCursor = LoadCursor(nullptr, IDC_ARROW);
4444 wcx.lpszClassName = L"TortoiseIDiffPicWindow";
45- wcx.hIcon = LoadIconEx(hResource, MAKEINTRESOURCE(IDI_TORTOISEIDIFF));
45+ wcx.hIcon = LoadIconEx(hResource, MAKEINTRESOURCE(IDI_TORTOISEIDIFF), GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
4646 wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
4747 wcx.lpszMenuName = MAKEINTRESOURCE(IDC_TORTOISEIDIFF);
4848 wcx.hIconSm = LoadIconEx(wcx.hInstance, MAKEINTRESOURCE(IDI_TORTOISEIDIFF));
@@ -59,14 +59,15 @@
5959
6060 void CPicWindow::PositionTrackBar()
6161 {
62+ const auto slider_width = CDPIAware::Instance().Scale(SLIDER_WIDTH);
6263 RECT rc;
6364 GetClientRect(&rc);
6465 HWND slider = m_AlphaSlider.GetWindow();
65- if ((pSecondPic)&&(m_blend == BLEND_ALPHA))
66+ if ((pSecondPic) && (m_blend == BLEND_ALPHA))
6667 {
67- MoveWindow(slider, 0, rc.top-4+SLIDER_WIDTH, SLIDER_WIDTH, rc.bottom-rc.top-SLIDER_WIDTH+8, true);
68+ MoveWindow(slider, 0, rc.top - CDPIAware::Instance().Scale(4) + slider_width, slider_width, rc.bottom - rc.top - slider_width + CDPIAware::Instance().Scale(8), true);
6869 ShowWindow(slider, SW_SHOW);
69- MoveWindow(hwndAlphaToggleBtn, 0, rc.top-4, SLIDER_WIDTH, SLIDER_WIDTH, true);
70+ MoveWindow(hwndAlphaToggleBtn, 0, rc.top - CDPIAware::Instance().Scale(4), slider_width, slider_width, true);
7071 ShowWindow(hwndAlphaToggleBtn, SW_SHOW);
7172 }
7273 else
@@ -246,7 +247,7 @@
246247 mevt.hwndTrack = *this;
247248 ::TrackMouseEvent(&mevt);
248249 POINT pt = {((int)(short)LOWORD(lParam)), ((int)(short)HIWORD(lParam))};
249- if (pt.y < HEADER_HEIGHT)
250+ if (pt.y < CDPIAware::Instance().Scale(HEADER_HEIGHT))
250251 {
251252 ClientToScreen(*this, &pt);
252253 if ((abs(m_lastTTPos.x - pt.x) > 20)||(abs(m_lastTTPos.y - pt.y) > 10))
@@ -575,6 +576,7 @@
575576
576577 void CPicWindow::DrawViewTitle(HDC hDC, RECT * rect)
577578 {
579+ const auto header_height = CDPIAware::Instance().Scale(HEADER_HEIGHT);
578580 HFONT hFont = nullptr;
579581 hFont = CreateFont(-CDPIAware::Instance().PointsToPixels(pSecondPic ? 8 : 10), 0, 0, 0, FW_DONTCARE, false, false, false, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, DEFAULT_PITCH, L"MS Shell Dlg");
580582 HFONT hFontOld = (HFONT)SelectObject(hDC, (HGDIOBJ)hFont);
@@ -583,9 +585,9 @@
583585 textrect.left = rect->left;
584586 textrect.top = rect->top;
585587 textrect.right = rect->right;
586- textrect.bottom = rect->top + HEADER_HEIGHT;
588+ textrect.bottom = rect->top + header_height;
587589 if (HasMultipleImages())
588- textrect.bottom += HEADER_HEIGHT;
590+ textrect.bottom += header_height;
589591
590592 COLORREF crBk, crFg;
591593 crBk = ::GetSysColor(COLOR_SCROLLBAR);
@@ -620,7 +622,7 @@
620622 if (GetTextExtentPoint32(hDC, realtitle.c_str(), (int)realtitle.size(), &stringsize))
621623 {
622624 int nStringLength = stringsize.cx;
623- int texttop = pSecondPic ? textrect.top + (HEADER_HEIGHT/2) - stringsize.cy : textrect.top + (HEADER_HEIGHT/2) - stringsize.cy/2;
625+ int texttop = pSecondPic ? textrect.top + (header_height /2) - stringsize.cy : textrect.top + (header_height /2) - stringsize.cy/2;
624626 ExtTextOut(hDC,
625627 max(textrect.left + ((textrect.right-textrect.left)-nStringLength)/2, 1),
626628 texttop,
@@ -650,7 +652,7 @@
650652
651653 ExtTextOut(hDC,
652654 max(textrect.left + ((textrect.right-textrect.left)-nStringLength)/2, 1),
653- textrect.top + HEADER_HEIGHT + (HEADER_HEIGHT/2) - stringsize.cy/2,
655+ textrect.top + header_height + (header_height /2) - stringsize.cy/2,
654656 ETO_CLIPPED,
655657 &textrect,
656658 imgnumstring.c_str(),
@@ -910,13 +912,13 @@
910912 void CPicWindow::GetClientRect(RECT * pRect)
911913 {
912914 ::GetClientRect(*this, pRect);
913- pRect->top += HEADER_HEIGHT;
915+ pRect->top += CDPIAware::Instance().Scale(HEADER_HEIGHT);
914916 if (HasMultipleImages())
915917 {
916- pRect->top += HEADER_HEIGHT;
918+ pRect->top += CDPIAware::Instance().Scale(HEADER_HEIGHT);
917919 }
918920 if (pSecondPic)
919- pRect->left += SLIDER_WIDTH;
921+ pRect->left += CDPIAware::Instance().Scale(SLIDER_WIDTH);
920922 }
921923
922924 void CPicWindow::GetClientRectWithScrollbars(RECT * pRect)
@@ -927,13 +929,13 @@
927929 pRect->bottom = pRect->bottom-pRect->top;
928930 pRect->top = 0;
929931 pRect->left = 0;
930- pRect->top += HEADER_HEIGHT;
932+ pRect->top += CDPIAware::Instance().Scale(HEADER_HEIGHT);
931933 if (HasMultipleImages())
932934 {
933- pRect->top += HEADER_HEIGHT;
935+ pRect->top += CDPIAware::Instance().Scale(HEADER_HEIGHT);
934936 }
935937 if (pSecondPic)
936- pRect->left += SLIDER_WIDTH;
938+ pRect->left += CDPIAware::Instance().Scale(SLIDER_WIDTH);
937939 };
938940
939941
@@ -1060,10 +1062,11 @@
10601062
10611063 GetClientRectWithScrollbars(&rect);
10621064
1065+ const auto border = CDPIAware::Instance().Scale(2);
10631066 if (rect.right-rect.left)
10641067 {
10651068 int Zoom = 100;
1066- if (((rect.right - rect.left) > picture.m_Width+2)&&((rect.bottom - rect.top)> picture.m_Height+2))
1069+ if (((rect.right - rect.left) > picture.m_Width + border) && ((rect.bottom - rect.top) > picture.m_Height + border))
10671070 {
10681071 // image is smaller than the window
10691072 Zoom = 100;
@@ -1071,13 +1074,13 @@
10711074 else
10721075 {
10731076 // image is bigger than the window
1074- int xscale = (rect.right-rect.left-2)*100/picture.m_Width;
1075- int yscale = (rect.bottom-rect.top-2)*100/picture.m_Height;
1077+ int xscale = (rect.right - rect.left - border) * 100 / picture.m_Width;
1078+ int yscale = (rect.bottom - rect.top - border) * 100 / picture.m_Height;
10761079 Zoom = min(yscale, xscale);
10771080 }
10781081 if (pSecondPic)
10791082 {
1080- if (((rect.right - rect.left) > pSecondPic->m_Width+2)&&((rect.bottom - rect.top)> pSecondPic->m_Height+2))
1083+ if (((rect.right - rect.left) > pSecondPic->m_Width + border) && ((rect.bottom - rect.top) > pSecondPic->m_Height + border))
10811084 {
10821085 // image is smaller than the window
10831086 if (pTheOtherPic)
@@ -1086,8 +1089,8 @@
10861089 else
10871090 {
10881091 // image is bigger than the window
1089- int xscale = (rect.right-rect.left-2)*100/pSecondPic->m_Width;
1090- int yscale = (rect.bottom-rect.top-2)*100/pSecondPic->m_Height;
1092+ int xscale = (rect.right - rect.left - border) * 100 / pSecondPic->m_Width;
1093+ int yscale = (rect.bottom - rect.top - border) * 100 / pSecondPic->m_Height;
10911094 if (pTheOtherPic)
10921095 pTheOtherPic->SetZoom(min(yscale, xscale), false);
10931096 }
@@ -1105,12 +1108,13 @@
11051108 {
11061109 RECT rect;
11071110 GetClientRectWithScrollbars(&rect);
1108- long width = picture.m_Width*picscale/100 + 2;
1109- long height = picture.m_Height*picscale/100 + 2;
1111+ const auto border = CDPIAware::Instance().Scale(2);
1112+ long width = picture.m_Width*picscale / 100 + border;
1113+ long height = picture.m_Height*picscale / 100 + border;
11101114 if (pSecondPic && pTheOtherPic)
11111115 {
1112- width = max(width, pSecondPic->m_Width*pTheOtherPic->GetZoom()/100 + 2);
1113- height = max(height, pSecondPic->m_Height*pTheOtherPic->GetZoom()/100 + 2);
1116+ width = max(width, pSecondPic->m_Width*pTheOtherPic->GetZoom() / 100 + border);
1117+ height = max(height, pSecondPic->m_Height*pTheOtherPic->GetZoom() / 100 + border);
11141118 }
11151119
11161120 bool bPicWidthBigger = (int(width) > (rect.right-rect.left));
@@ -1167,11 +1171,13 @@
11671171
11681172 pic.Show(hdc, picrect);
11691173
1174+ const auto bordersize = CDPIAware::Instance().Scale(1);
1175+
11701176 RECT border;
1171- border.left = picrect.left-1;
1172- border.top = picrect.top-1;
1173- border.right = picrect.right+1;
1174- border.bottom = picrect.bottom+1;
1177+ border.left = picrect.left - bordersize;
1178+ border.top = picrect.top - bordersize;
1179+ border.right = picrect.right + bordersize;
1180+ border.bottom = picrect.bottom + bordersize;
11751181
11761182 HPEN hPen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DDKSHADOW));
11771183 HPEN hOldPen = (HPEN)SelectObject(hdc, hPen);
@@ -1194,12 +1200,14 @@
11941200 if (IsRectEmpty(&rect))
11951201 return;
11961202
1203+ const auto slider_width = CDPIAware::Instance().Scale(SLIDER_WIDTH);
1204+ const auto border = CDPIAware::Instance().Scale(4);
11971205 ::GetClientRect(*this, &fullrect);
11981206 hdc = BeginPaint(hwnd, &ps);
11991207 {
12001208 // Exclude the alpha control and button
12011209 if ((pSecondPic)&&(m_blend == BLEND_ALPHA))
1202- ExcludeClipRect(hdc, 0, m_inforect.top-4, SLIDER_WIDTH, m_inforect.bottom+4);
1210+ ExcludeClipRect(hdc, 0, m_inforect.top - border, slider_width, m_inforect.bottom + border);
12031211
12041212 CMyMemDC memDC(hdc);
12051213 if ((pSecondPic)&&(m_blend != BLEND_ALPHA))
@@ -1206,7 +1214,7 @@
12061214 {
12071215 // erase the place where the alpha slider would be
12081216 ::SetBkColor(memDC, transparentColor);
1209- RECT bounds = {0, m_inforect.top-4, SLIDER_WIDTH, m_inforect.bottom+4};
1217+ RECT bounds = { 0, m_inforect.top - border, slider_width, m_inforect.bottom + border };
12101218 ::ExtTextOut(memDC, 0, 0, ETO_OPAQUE, &bounds, nullptr, 0, nullptr);
12111219 }
12121220
@@ -1225,7 +1233,7 @@
12251233 {
12261234 // erase the place where the alpha slider would be
12271235 ::SetBkColor(secondhdc, transparentColor);
1228- RECT bounds = {0, m_inforect.top-4, SLIDER_WIDTH, m_inforect.bottom+4};
1236+ RECT bounds = { 0, m_inforect.top - border, slider_width, m_inforect.bottom + border };
12291237 ::ExtTextOut(secondhdc, 0, 0, ETO_OPAQUE, &bounds, nullptr, 0, nullptr);
12301238 }
12311239 if (pTheOtherPic)
@@ -1298,8 +1306,8 @@
12981306
12991307 int sliderwidth = 0;
13001308 if ((pSecondPic)&&(m_blend == BLEND_ALPHA))
1301- sliderwidth = SLIDER_WIDTH;
1302- m_inforect.left = rect.left+4+sliderwidth;
1309+ sliderwidth = slider_width;
1310+ m_inforect.left = rect.left + border + sliderwidth;
13031311 m_inforect.top = rect.top;
13041312 m_inforect.right = rect.right+sliderwidth;
13051313 m_inforect.bottom = rect.bottom;
@@ -1319,15 +1327,15 @@
13191327 DrawText(memDC, infostring.get(), -1, &m_inforect, DT_EDITCONTROL | DT_EXPANDTABS | DT_LEFT | DT_VCENTER | DT_CALCRECT);
13201328
13211329 // the text should be drawn with a four pixel offset to the window borders
1322- m_inforect.top = rect.bottom - (m_inforect.bottom-m_inforect.top) - 4;
1330+ m_inforect.top = rect.bottom - (m_inforect.bottom-m_inforect.top) - border;
13231331 m_inforect.bottom = rect.bottom-4;
13241332
13251333 // first draw an edge rectangle
13261334 RECT edgerect;
1327- edgerect.left = m_inforect.left-4;
1328- edgerect.top = m_inforect.top-4;
1329- edgerect.right = m_inforect.right+4;
1330- edgerect.bottom = m_inforect.bottom+4;
1335+ edgerect.left = m_inforect.left - border;
1336+ edgerect.top = m_inforect.top - border;
1337+ edgerect.right = m_inforect.right + border;
1338+ edgerect.bottom = m_inforect.bottom + border;
13311339 ::ExtTextOut(memDC, 0, 0, ETO_OPAQUE, &edgerect, nullptr, 0, nullptr);
13321340 DrawEdge(memDC, &edgerect, EDGE_BUMP, BF_RECT | BF_SOFT);
13331341
@@ -1468,6 +1476,8 @@
14681476
14691477 void CPicWindow::PositionChildren()
14701478 {
1479+ const auto header_height = CDPIAware::Instance().Scale(HEADER_HEIGHT);
1480+ const auto selBorder = CDPIAware::Instance().Scale(100);
14711481 RECT rect;
14721482 ::GetClientRect(*this, &rect);
14731483 if (HasMultipleImages())
@@ -1474,10 +1484,10 @@
14741484 {
14751485 int iconWidth = GetSystemMetrics(SM_CXSMICON);
14761486 int iconHeight = GetSystemMetrics(SM_CYSMICON);
1477- SetWindowPos(hwndLeftBtn, HWND_TOP, rect.left + iconWidth / 4, rect.top + HEADER_HEIGHT + (HEADER_HEIGHT-iconHeight)/2, iconWidth, iconHeight, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
1478- SetWindowPos(hwndRightBtn, HWND_TOP, rect.left + iconWidth + iconWidth / 2, rect.top + HEADER_HEIGHT + (HEADER_HEIGHT - iconHeight) / 2, iconWidth, iconHeight, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
1487+ SetWindowPos(hwndLeftBtn, HWND_TOP, rect.left + iconWidth / 4, rect.top + header_height + (header_height -iconHeight)/2, iconWidth, iconHeight, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
1488+ SetWindowPos(hwndRightBtn, HWND_TOP, rect.left + iconWidth + iconWidth / 2, rect.top + header_height + (header_height - iconHeight) / 2, iconWidth, iconHeight, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
14791489 if (nFrames > 1)
1480- SetWindowPos(hwndPlayBtn, HWND_TOP, rect.left + iconWidth * 2 + iconWidth / 2, rect.top + HEADER_HEIGHT + (HEADER_HEIGHT - iconHeight) / 2, iconWidth, iconHeight, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
1490+ SetWindowPos(hwndPlayBtn, HWND_TOP, rect.left + iconWidth * 2 + iconWidth / 2, rect.top + header_height + (header_height - iconHeight) / 2, iconWidth, iconHeight, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
14811491 else
14821492 ShowWindow(hwndPlayBtn, SW_HIDE);
14831493 }
@@ -1488,7 +1498,7 @@
14881498 ShowWindow(hwndPlayBtn, SW_HIDE);
14891499 }
14901500 if (bSelectionMode)
1491- SetWindowPos(hwndSelectBtn, HWND_TOP, rect.right-100, rect.bottom-HEADER_HEIGHT, 100, HEADER_HEIGHT, SWP_FRAMECHANGED|SWP_SHOWWINDOW);
1501+ SetWindowPos(hwndSelectBtn, HWND_TOP, rect.right - selBorder, rect.bottom - header_height, selBorder, header_height, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
14921502 else
14931503 ShowWindow(hwndSelectBtn, SW_HIDE);
14941504 PositionTrackBar();
Show on old repository browser