• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28324 (tree)
Time2018-07-28 21:29:41
Authorstefankueng

Log Message

Merged revision(s) r28321, r28322, r28323 from trunk:
* Set the splitter ranges DPI-aware.
* Adjust the three resizable controls and the splitters accordingly when resizing the dialog.
* save the project monitor splitter positions separately from the log dialog splitter positions.

Change Summary

Incremental Difference

--- branches/1.10.x/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28323)
+++ branches/1.10.x/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28324)
@@ -73,6 +73,8 @@
7373 #include "../LogCache/Streams/StreamException.h"
7474
7575 #define ICONITEMBORDER 5
76+#define MIN_CTRL_HEIGHT (CDPIAware::Instance().Scale(20))
77+#define MIN_SPLITTER_HEIGHT (CDPIAware::Instance().Scale(10))
7678
7779 const UINT CLogDlg::m_FindDialogMessage = RegisterWindowMessage(FINDMSGSTRING);
7880 const UINT CLogDlg::WM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated");
@@ -630,9 +632,9 @@
630632
631633 void CLogDlg::RestoreLogDlgWindowAndSplitters()
632634 {
633- DWORD yPos1 = CRegDWORD(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer1");
634- DWORD yPos2 = CRegDWORD(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer2");
635- DWORD xPos = CRegDWORD(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer3");
635+ DWORD yPos1 = CRegDWORD(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer1" + m_bMonitoringMode ? L"M" : L"");
636+ DWORD yPos2 = CRegDWORD(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer2" + m_bMonitoringMode ? L"M" : L"");
637+ DWORD xPos = CRegDWORD(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer3" + m_bMonitoringMode ? L"M" : L"");
636638 RECT rcDlg, rcLogList, rcChgMsg, rcProjTree;
637639 GetClientRect(&rcDlg);
638640 m_LogList.GetWindowRect(&rcLogList);
@@ -1336,9 +1338,9 @@
13361338 {
13371339 if (!IsIconic())
13381340 {
1339- CRegDWORD regPos1(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer1");
1340- CRegDWORD regPos2(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer2");
1341- CRegDWORD regPos3(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer3");
1341+ CRegDWORD regPos1(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer1" + m_bMonitoringMode ? L"M" : L"");
1342+ CRegDWORD regPos2(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer2" + m_bMonitoringMode ? L"M" : L"");
1343+ CRegDWORD regPos3(L"Software\\TortoiseSVN\\TortoiseProc\\ResizableState\\LogDlgSizer3" + m_bMonitoringMode ? L"M" : L"");
13421344 RECT rectSplitter;
13431345 m_wndSplitter1.GetWindowRect(&rectSplitter);
13441346 ScreenToClient(&rectSplitter);
@@ -4126,9 +4128,9 @@
41264128 m_ChangedFileListCtrl.GetWindowRect(rcBottom);
41274129 ScreenToClient(rcBottom);
41284130
4129- m_wndSplitter1.SetRange(rcTop.top+20, rcBottom.bottom-50);
4130- m_wndSplitter2.SetRange(rcTop.top+50, rcBottom.bottom-20);
4131- m_wndSplitterLeft.SetRange(80, rcTop.right - m_LogListOrigRect.Width());
4131+ m_wndSplitter1.SetRange(rcTop.top + MIN_CTRL_HEIGHT, rcBottom.bottom - (2 * MIN_CTRL_HEIGHT + MIN_SPLITTER_HEIGHT));
4132+ m_wndSplitter2.SetRange(rcTop.top + (2 * MIN_CTRL_HEIGHT + MIN_SPLITTER_HEIGHT), rcBottom.bottom - MIN_CTRL_HEIGHT);
4133+ m_wndSplitterLeft.SetRange(CDPIAware::Instance().Scale(80), rcTop.right - m_LogListOrigRect.Width());
41324134 }
41334135 }
41344136
@@ -6313,9 +6315,9 @@
63136315 void CLogDlg::OnSize(UINT nType, int cx, int cy)
63146316 {
63156317 __super::OnSize(nType, cx, cy);
6316- //set range
63176318 if ((m_LogList) && (m_ChangedFileListCtrl))
63186319 {
6320+ // correct the splitter positions if they're out of bounds
63196321 CRect rcTop;
63206322 m_LogList.GetWindowRect(rcTop);
63216323 ScreenToClient(rcTop);
@@ -6328,38 +6330,108 @@
63286330 m_ChangedFileListCtrl.GetWindowRect(rcBottom);
63296331 ScreenToClient(rcBottom);
63306332
6331- if (rcMiddle.Height() < 100)
6332- {
6333- CRect rc;
6334- m_wndSplitter2.GetWindowRect(&rc);
6335- ScreenToClient(rc);
6336- rc.MoveToY(rc.top + 20);
6337- m_wndSplitter2.MoveWindow(&rc);
6338- DoSizeV2(20);
6339- }
6333+ CRect rcBottomLimit;
6334+ GetDlgItem(IDC_LOGINFO)->GetWindowRect(rcBottomLimit);
6335+ ScreenToClient(rcBottomLimit);
63406336
6341- if (rcTop.Height() < 100)
6337+ auto minCtrlHeight = MIN_CTRL_HEIGHT;
6338+
6339+ // the IDC_LOGINFO and the changed file list control
6340+ // have a space of 3 dlg units between them (check in the dlg resource editor)
6341+ CRect dlgUnitRect(0, 0, 3, 3);
6342+ MapDialogRect(&dlgUnitRect);
6343+
6344+ if ((rcTop.Height() < minCtrlHeight) ||
6345+ (rcMiddle.Height() < minCtrlHeight) ||
6346+ (rcBottom.Height() < minCtrlHeight) ||
6347+ (rcBottom.bottom > rcBottomLimit.top - dlgUnitRect.bottom))
63426348 {
6343- CRect rc;
6344- m_wndSplitter1.GetWindowRect(&rc);
6345- ScreenToClient(rc);
6346- rc.MoveToY(rc.top + 20);
6347- m_wndSplitter1.MoveWindow(&rc);
6348- DoSizeV1(20);
6349- }
6349+ // controls sizes and splitters need adjusting
6350+ RemoveMainAnchors();
63506351
6351- m_LogList.GetWindowRect(rcTop);
6352- ScreenToClient(rcTop);
6352+ auto hdwp = BeginDeferWindowPos(5);
6353+ auto hdwpflags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOZORDER;
6354+ auto splitterHeight = MIN_SPLITTER_HEIGHT;
63536355
6354- GetDlgItem(IDC_MSGVIEW)->GetWindowRect(rcMiddle);
6355- ScreenToClient(rcMiddle);
6356+ if ((rcBottom.bottom > rcBottomLimit.top - dlgUnitRect.bottom) || (rcBottom.Height() < minCtrlHeight))
6357+ {
6358+ // the bottom of the changed files list control is
6359+ // below the point it should get, so move it upwards.
6360+ // or the control is too small and needs extending.
6361+ rcBottom.bottom = rcBottomLimit.top + dlgUnitRect.bottom;
6362+ rcBottom.top = min(rcBottom.top, rcBottom.bottom - minCtrlHeight);
6363+ DeferWindowPos(hdwp, m_ChangedFileListCtrl.GetSafeHwnd(), nullptr, rcBottom.left, rcBottom.top, rcBottom.Width(), rcBottom.Height(), hdwpflags);
6364+ if (rcBottom.top < rcMiddle.bottom + splitterHeight)
6365+ {
6366+ // we also need to move splitter2 and rcMiddle.bottom upwards
6367+ CRect rcSplitter2;
6368+ m_wndSplitter2.GetWindowRect(rcSplitter2);
6369+ ScreenToClient(rcSplitter2);
6370+ rcSplitter2.top = rcBottom.top - splitterHeight;
6371+ rcSplitter2.bottom = rcBottom.top;
6372+ DeferWindowPos(hdwp, m_wndSplitter2.GetSafeHwnd(), nullptr, rcSplitter2.left, rcSplitter2.top, rcSplitter2.Width(), rcSplitter2.Height(), hdwpflags);
6373+ rcMiddle.bottom = rcSplitter2.top;
6374+ if (rcMiddle.Height() < minCtrlHeight)
6375+ {
6376+ // now the message view is too small, we have to
6377+ // move splitter1 upwards and resize the top view
6378+ CRect rcSplitter1;
6379+ m_wndSplitter1.GetWindowRect(rcSplitter1);
6380+ ScreenToClient(rcSplitter1);
6381+ rcMiddle.top = min(rcMiddle.top, rcMiddle.bottom - minCtrlHeight);
6382+ rcSplitter1.top = rcMiddle.top - splitterHeight;
6383+ rcSplitter1.bottom = rcMiddle.top;
6384+ DeferWindowPos(hdwp, m_wndSplitter1.GetSafeHwnd(), nullptr, rcSplitter1.left, rcSplitter1.top, rcSplitter1.Width(), rcSplitter1.Height(), hdwpflags);
6385+ rcTop.bottom = rcSplitter1.top;
6386+ DeferWindowPos(hdwp, m_LogList.GetSafeHwnd(), nullptr, rcTop.left, rcTop.top, rcTop.Width(), rcTop.Height(), hdwpflags);
6387+ }
6388+ rcMiddle.top = min(rcMiddle.top, rcMiddle.bottom - minCtrlHeight);
6389+ DeferWindowPos(hdwp, GetDlgItem(IDC_MSGVIEW)->GetSafeHwnd(), nullptr, rcMiddle.left, rcMiddle.top, rcMiddle.Width(), rcMiddle.Height(), hdwpflags);
6390+ }
6391+ }
6392+ if (rcTop.Height() < minCtrlHeight)
6393+ {
6394+ // the log list view is too small. Extend its height down and move splitter1 down.
6395+ rcTop.bottom = rcTop.top + minCtrlHeight;
6396+ DeferWindowPos(hdwp, m_LogList.GetSafeHwnd(), nullptr, rcTop.left, rcTop.top, rcTop.Width(), rcTop.Height(), hdwpflags);
6397+ CRect rcSplitter1;
6398+ m_wndSplitter1.GetWindowRect(rcSplitter1);
6399+ ScreenToClient(rcSplitter1);
6400+ rcSplitter1.top = rcTop.bottom;
6401+ rcSplitter1.bottom = rcSplitter1.top + splitterHeight;
6402+ DeferWindowPos(hdwp, m_wndSplitter1.GetSafeHwnd(), nullptr, rcSplitter1.left, rcSplitter1.top, rcSplitter1.Width(), rcSplitter1.Height(), hdwpflags);
6403+ // since splitter1 moves down, also adjust the message view
6404+ rcMiddle.top = rcSplitter1.bottom;
6405+ DeferWindowPos(hdwp, GetDlgItem(IDC_MSGVIEW)->GetSafeHwnd(), nullptr, rcMiddle.left, rcMiddle.top, rcMiddle.Width(), rcMiddle.Height(), hdwpflags);
6406+ }
6407+ if (rcMiddle.Height() < minCtrlHeight)
6408+ {
6409+ // the message view is too small. Extend its height down and move splitter2 down;
6410+ rcMiddle.bottom = rcMiddle.top + minCtrlHeight;
6411+ DeferWindowPos(hdwp, GetDlgItem(IDC_MSGVIEW)->GetSafeHwnd(), nullptr, rcMiddle.left, rcMiddle.top, rcMiddle.Width(), rcMiddle.Height(), hdwpflags);
6412+ CRect rcSplitter2;
6413+ m_wndSplitter2.GetWindowRect(rcSplitter2);
6414+ ScreenToClient(rcSplitter2);
6415+ rcSplitter2.top = rcMiddle.bottom;
6416+ rcSplitter2.bottom = rcSplitter2.top + splitterHeight;
6417+ DeferWindowPos(hdwp, m_wndSplitter2.GetSafeHwnd(), nullptr, rcSplitter2.left, rcSplitter2.top, rcSplitter2.Width(), rcSplitter2.Height(), hdwpflags);
6418+ // since splitter2 moves down, also adjust the changed files list control
6419+ rcBottom.top = rcSplitter2.bottom;
6420+ DeferWindowPos(hdwp, m_ChangedFileListCtrl.GetSafeHwnd(), nullptr, rcBottom.left, rcBottom.top, rcBottom.Width(), rcBottom.Height(), hdwpflags);
6421+ }
6422+ EndDeferWindowPos(hdwp);
63566423
6357- m_ChangedFileListCtrl.GetWindowRect(rcBottom);
6358- ScreenToClient(rcBottom);
6424+ AddMainAnchors();
6425+ ArrangeLayout();
6426+ }
63596427
6360- m_wndSplitter1.SetRange(rcTop.top + 20, rcBottom.bottom - 50);
6361- m_wndSplitter2.SetRange(rcTop.top + 50, rcBottom.bottom - 20);
6362- m_wndSplitterLeft.SetRange(80, rcTop.right - m_LogListOrigRect.Width());
6428+ m_wndSplitter1.SetRange(rcTop.top + MIN_CTRL_HEIGHT, rcBottom.bottom - (2 * MIN_CTRL_HEIGHT + MIN_SPLITTER_HEIGHT));
6429+ m_wndSplitter2.SetRange(rcTop.top + (2 * MIN_CTRL_HEIGHT + MIN_SPLITTER_HEIGHT), rcBottom.bottom - MIN_CTRL_HEIGHT);
6430+ m_wndSplitterLeft.SetRange(CDPIAware::Instance().Scale(80), rcTop.right - m_LogListOrigRect.Width());
6431+
6432+ m_LogList.Invalidate();
6433+ m_ChangedFileListCtrl.Invalidate();
6434+ GetDlgItem(IDC_MSGVIEW)->Invalidate();
63636435 }
63646436 }
63656437
--- branches/1.10.x/src/Changelog.txt (revision 28323)
+++ branches/1.10.x/src/Changelog.txt (revision 28324)
@@ -1,4 +1,10 @@
1-Version 1.10.1
1+Version 1.10.2
2+- BUG: Display issues in the log dialog when
3+ resizing the dialog. (Stefan)
4+- CHG: splitter positions saved separately
5+ for log dialog and project monitor. (Stefan)
6+
7+Version 1.10.1
28 - BUG: Wrong texts in conflict resolving
39 dialogs. (Stefan)
410 - BUG: Shelving from TSVN dialogs returned
Show on old repository browser