• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28330 (tree)
Time2018-08-04 15:21:57
Authorstefankueng

Log Message

make the icon borders and min heights of the splitters in the log dialog dpi aware.

Change Summary

Incremental Difference

--- trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28329)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28330)
@@ -645,7 +645,7 @@
645645 m_projTree.GetWindowRect(&rcProjTree);
646646 ScreenToClient(&rcProjTree);
647647
648- if (yPos1 && ((LONG)yPos1 < rcDlg.bottom - 185))
648+ if (yPos1 && ((LONG)yPos1 < rcDlg.bottom - CDPIAware::Instance().Scale(185)))
649649 {
650650 RECT rectSplitter;
651651 m_wndSplitter1.GetWindowRect(&rectSplitter);
@@ -652,13 +652,13 @@
652652 ScreenToClient(&rectSplitter);
653653 int delta = yPos1 - rectSplitter.top;
654654
655- if ((rcLogList.bottom + delta > rcLogList.top)&&(rcLogList.bottom + delta < rcChgMsg.bottom - 30))
655+ if ((rcLogList.bottom + delta > rcLogList.top)&&(rcLogList.bottom + delta < rcChgMsg.bottom - CDPIAware::Instance().Scale(30)))
656656 {
657657 m_wndSplitter1.SetWindowPos(NULL, rectSplitter.left, yPos1, 0, 0, SWP_NOSIZE);
658658 DoSizeV1(delta);
659659 }
660660 }
661- if (yPos2 && ((LONG)yPos2 < rcDlg.bottom - 153))
661+ if (yPos2 && ((LONG)yPos2 < rcDlg.bottom - CDPIAware::Instance().Scale(153)))
662662 {
663663 RECT rectSplitter;
664664 m_wndSplitter2.GetWindowRect(&rectSplitter);
@@ -665,7 +665,7 @@
665665 ScreenToClient(&rectSplitter);
666666 int delta = yPos2 - rectSplitter.top;
667667
668- if ((rcChgMsg.top + delta < rcChgMsg.bottom)&&(rcChgMsg.top + delta > rcLogList.top + 30))
668+ if ((rcChgMsg.top + delta < rcChgMsg.bottom)&&(rcChgMsg.top + delta > rcLogList.top + CDPIAware::Instance().Scale(30)))
669669 {
670670 m_wndSplitter2.SetWindowPos(NULL, rectSplitter.left, yPos2, 0, 0, SWP_NOSIZE);
671671 DoSizeV2(delta);
@@ -674,7 +674,7 @@
674674 if (m_bMonitoringMode)
675675 {
676676 if (xPos == 0)
677- xPos = 80;
677+ xPos = CDPIAware::Instance().Scale(80);
678678 RECT rectSplitter;
679679 m_wndSplitterLeft.GetWindowRect(&rectSplitter);
680680 ScreenToClient(&rectSplitter);
@@ -3564,35 +3564,35 @@
35643564 BitBlt(myDC.GetDC(), rect.left, rect.top, rect.Width(), rect.Height(), pLVCD->nmcd.hdc, rect.left, rect.top, SRCCOPY);
35653565
35663566 // Draw the icon(s) into the compatible DC
3567-
3567+ auto iconItemBorder = CDPIAware::Instance().Scale(ICONITEMBORDER);
35683568 DWORD actions = pLogEntry->GetChangedPaths().GetActions();
35693569 if (actions & LOGACTIONS_MODIFIED)
3570- ::DrawIconEx(myDC.GetDC(), rect.left + ICONITEMBORDER, rect.top,
3570+ ::DrawIconEx(myDC.GetDC(), rect.left + iconItemBorder, rect.top,
35713571 m_hModifiedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);
35723572 nIcons++;
35733573
35743574 if (actions & LOGACTIONS_ADDED)
3575- ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + ICONITEMBORDER,
3575+ ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + iconItemBorder,
35763576 rect.top, m_hAddedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);
35773577 nIcons++;
35783578
35793579 if (actions & LOGACTIONS_DELETED)
3580- ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + ICONITEMBORDER,
3580+ ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + iconItemBorder,
35813581 rect.top, m_hDeletedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);
35823582 nIcons++;
35833583
35843584 if (actions & LOGACTIONS_REPLACED)
3585- ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + ICONITEMBORDER,
3585+ ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + iconItemBorder,
35863586 rect.top, m_hReplacedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);
35873587 nIcons++;
35883588
35893589 if (actions & LOGACTIONS_MOVED)
3590- ::DrawIconEx(myDC.GetDC(), rect.left + nIcons*iconwidth + ICONITEMBORDER,
3590+ ::DrawIconEx(myDC.GetDC(), rect.left + nIcons*iconwidth + iconItemBorder,
35913591 rect.top, m_hMovedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);
35923592 nIcons++;
35933593
35943594 if (actions & LOGACTIONS_MOVEREPLACED)
3595- ::DrawIconEx(myDC.GetDC(), rect.left + nIcons*iconwidth + ICONITEMBORDER,
3595+ ::DrawIconEx(myDC.GetDC(), rect.left + nIcons*iconwidth + iconItemBorder,
35963596 rect.top, m_hMoveReplacedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);
35973597 nIcons++;
35983598
@@ -3600,10 +3600,10 @@
36003600 (m_mergedRevs.find(pLogEntry->GetRevision()) != m_mergedRevs.end()))
36013601 {
36023602 if (pLogEntry->IsSubtractiveMerge())
3603- ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + ICONITEMBORDER,
3603+ ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + iconItemBorder,
36043604 rect.top, m_hReverseMergedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);
36053605 else
3606- ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + ICONITEMBORDER,
3606+ ::DrawIconEx(myDC.GetDC(), rect.left+nIcons*iconwidth + iconItemBorder,
36073607 rect.top, m_hMergedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);
36083608 }
36093609 nIcons++;
@@ -4932,7 +4932,7 @@
49324932 hdi.pszText = textbuf;
49334933 hdi.cchTextMax = _countof(textbuf) - 1;
49344934 pHdrCtrl->GetItem(col, &hdi);
4935- int cx = m_LogList.GetStringWidth(textbuf)+20; // 20 pixels for col separator and margin
4935+ int cx = m_LogList.GetStringWidth(textbuf) + CDPIAware::Instance().Scale(20); // 20 pixels for col separator and margin
49364936 for (size_t index = startRow; index<endRow; ++index)
49374937 {
49384938 // get the width of the string and add 14 pixels for the column separator and margins
@@ -4977,7 +4977,7 @@
49774977 // Adjust columns "Actions" containing icons
49784978 if (col == 1)
49794979 {
4980- const int nMinimumWidth = ICONITEMBORDER+GetSystemMetrics(SM_CXSMICON) * 7;
4980+ const int nMinimumWidth = CDPIAware::Instance().Scale(ICONITEMBORDER) + GetSystemMetrics(SM_CXSMICON) * 7;
49814981 if (cx < nMinimumWidth)
49824982 {
49834983 cx = nMinimumWidth;
Show on old repository browser