From 4f24f81eb8e0d1adc87da8d047531504d1b8232e Mon Sep 17 00:00:00 2001 From: Jon Bockhorst Date: Sat, 8 Dec 2018 22:40:31 -0600 Subject: [PATCH] Add new feature: double click splitter resets panes to equal size Close #5118 --- .../SplitterContainer/Splitter.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp index f1fd57dd..f933b5f3 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp @@ -364,6 +364,29 @@ LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lPara return 0; } + case WM_LBUTTONDBLCLK: + { + RECT r; + ::GetClientRect(_hParent, &r); + + if (_dwFlags & SV_HORIZONTAL) + { + _rect.top = r.bottom / 2; + } + else + { + _rect.left = r.right / 2; + } + + _splitPercent = 50; + + ::SendMessage(_hParent, WM_RESIZE_CONTAINER, _rect.left, _rect.top); + ::MoveWindow(_hSelf, _rect.left, _rect.top, _rect.right, _rect.bottom, FALSE); + redraw(); + + return 0; + } + case WM_LBUTTONUP: { if (!_isFixed)