• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28290 (tree)
Time2018-07-14 02:54:34
Authorstefankueng

Log Message

When resizing the log dialog, automatically adjust the splitters so the resizing can succeed.

Change Summary

Incremental Difference

--- trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28289)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28290)
@@ -4025,7 +4025,6 @@
40254025
40264026 AddMainAnchors();
40274027 ArrangeLayout();
4028- AdjustMinSize();
40294028 SetSplitterRange();
40304029 m_LogList.Invalidate();
40314030 m_ChangedFileListCtrl.Invalidate();
@@ -4057,7 +4056,6 @@
40574056
40584057 AddMainAnchors();
40594058 ArrangeLayout();
4060- AdjustMinSize();
40614059 SetSplitterRange();
40624060 GetDlgItem(IDC_MSGVIEW)->Invalidate();
40634061 m_ChangedFileListCtrl.Invalidate();
@@ -4081,7 +4079,6 @@
40814079
40824080 AddMainAnchors();
40834081 ArrangeLayout();
4084- AdjustMinSize();
40854082 SetSplitterRange();
40864083 GetDlgItem(IDC_MSGVIEW)->Invalidate();
40874084 m_LogList.Invalidate();
@@ -4089,22 +4086,6 @@
40894086 m_cFilter.Redraw();
40904087 }
40914088
4092-void CLogDlg::AdjustMinSize()
4093-{
4094- // adjust the minimum size of the dialog to prevent the resizing from
4095- // moving the list control too far down.
4096- CRect rcChgListView;
4097- m_ChangedFileListCtrl.GetClientRect(rcChgListView);
4098- CRect rcLogList;
4099- m_LogList.GetClientRect(rcLogList);
4100- CRect rcLogMsg;
4101- GetDlgItem(IDC_MSGVIEW)->GetClientRect(rcLogMsg);
4102-
4103- SetMinTrackSize(CSize(m_DlgOrigRect.Width(),
4104- m_DlgOrigRect.Height()-m_ChgOrigRect.Height()-m_LogListOrigRect.Height()-m_MsgViewOrigRect.Height()
4105- +rcLogMsg.Height()+abs(rcChgListView.Height()-rcLogList.Height())+60));
4106-}
4107-
41084089 LRESULT CLogDlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
41094090 {
41104091 switch (message) {
@@ -6337,7 +6318,53 @@
63376318 {
63386319 __super::OnSize(nType, cx, cy);
63396320 //set range
6340- SetSplitterRange();
6321+ if ((m_LogList) && (m_ChangedFileListCtrl))
6322+ {
6323+ CRect rcTop;
6324+ m_LogList.GetWindowRect(rcTop);
6325+ ScreenToClient(rcTop);
6326+
6327+ CRect rcMiddle;
6328+ GetDlgItem(IDC_MSGVIEW)->GetWindowRect(rcMiddle);
6329+ ScreenToClient(rcMiddle);
6330+
6331+ CRect rcBottom;
6332+ m_ChangedFileListCtrl.GetWindowRect(rcBottom);
6333+ ScreenToClient(rcBottom);
6334+
6335+ if (rcMiddle.Height() < 100)
6336+ {
6337+ CRect rc;
6338+ m_wndSplitter2.GetWindowRect(&rc);
6339+ ScreenToClient(rc);
6340+ rc.MoveToY(rc.top + 20);
6341+ m_wndSplitter2.MoveWindow(&rc);
6342+ DoSizeV2(20);
6343+ }
6344+
6345+ if (rcTop.Height() < 100)
6346+ {
6347+ CRect rc;
6348+ m_wndSplitter1.GetWindowRect(&rc);
6349+ ScreenToClient(rc);
6350+ rc.MoveToY(rc.top + 20);
6351+ m_wndSplitter1.MoveWindow(&rc);
6352+ DoSizeV1(20);
6353+ }
6354+
6355+ m_LogList.GetWindowRect(rcTop);
6356+ ScreenToClient(rcTop);
6357+
6358+ GetDlgItem(IDC_MSGVIEW)->GetWindowRect(rcMiddle);
6359+ ScreenToClient(rcMiddle);
6360+
6361+ m_ChangedFileListCtrl.GetWindowRect(rcBottom);
6362+ ScreenToClient(rcBottom);
6363+
6364+ m_wndSplitter1.SetRange(rcTop.top + 20, rcBottom.bottom - 50);
6365+ m_wndSplitter2.SetRange(rcTop.top + 50, rcBottom.bottom - 20);
6366+ m_wndSplitterLeft.SetRange(80, rcTop.right - m_LogListOrigRect.Width());
6367+ }
63416368 }
63426369
63436370 void CLogDlg::OnRefresh()
--- trunk/src/TortoiseProc/LogDialog/LogDlg.h (revision 28289)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.h (revision 28290)
@@ -261,7 +261,6 @@
261261 void EditLogMessage(size_t index);
262262 void DoSizeV1(int delta);
263263 void DoSizeV2(int delta);
264- void AdjustMinSize();
265264 void SetSplitterRange();
266265 void SetFilterCueText();
267266 void CopySelectionToClipBoard();
Show on old repository browser