Skip to content

Commit

Permalink
Add new feature: double click splitter resets panes to equal size
Browse files Browse the repository at this point in the history
Close #5118
  • Loading branch information
jmbockhorst authored and donho committed Dec 20, 2018
1 parent 412c598 commit 4f24f81
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 4f24f81

Please sign in to comment.