From faf5158366b325fefbefdf3ee6e4c26d473cc0e6 Mon Sep 17 00:00:00 2001 From: dmex Date: Fri, 12 May 2017 15:41:40 +1000 Subject: [PATCH] Remove splitter hack --- ProcessHacker/include/splitter.h | 2 +- ProcessHacker/splitter.c | 19 ++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/ProcessHacker/include/splitter.h b/ProcessHacker/include/splitter.h index f872c7a74..c1d6fcb4a 100644 --- a/ProcessHacker/include/splitter.h +++ b/ProcessHacker/include/splitter.h @@ -18,7 +18,7 @@ typedef struct _PH_HSPLITTER_CONTEXT LONG SplitterOffset; LONG SplitterPosition; - ULONG SplitterLayoutCount; + PH_LAYOUT_MANAGER LayoutManager; PPH_LAYOUT_ITEM Topitem; PPH_LAYOUT_ITEM Bottomitem; diff --git a/ProcessHacker/splitter.c b/ProcessHacker/splitter.c index ddecd07f2..f07d3a0d4 100644 --- a/ProcessHacker/splitter.c +++ b/ProcessHacker/splitter.c @@ -45,7 +45,7 @@ PPH_HSPLITTER_CONTEXT PhInitializeHSplitter( PhInitializeLayoutManager(&context->LayoutManager, Parent); context->SplitterOffset = -4; - context->SplitterPosition = PhGetIntegerSetting(L"TokenSplitterPosition"); + context->SplitterPosition = 250;// PhGetIntegerSetting(L"TokenSplitterPosition"); context->Topitem = PhAddLayoutItem(&context->LayoutManager, TopChild, NULL, PH_ANCHOR_ALL); context->Bottomitem = PhAddLayoutItem(&context->LayoutManager, BottomChild, NULL, PH_ANCHOR_ALL); @@ -68,18 +68,11 @@ VOID PhHSplitterHandleWmSize( ) { // HACK: Use the PH layout manager as the 'splitter' control by abusing layout margins. - - if (Context->SplitterLayoutCount >= 2) - { - // BUG: If the window is maximized and you move the splitter to the bottom, restoring the window causes - // the bottom control to get moved outside the visible area... Just move the splitter back up. - if ((Context->Bottomitem->Rect.bottom - Context->Bottomitem->Rect.top) <= 100) - Context->SplitterPosition = Context->Topitem->Rect.bottom - Context->Topitem->Rect.top - SPLITTER_PADDING; - } - else - { - Context->SplitterLayoutCount++; - } + + // BUG: If the window is maximized and you move the splitter to the bottom, restoring the window causes + // the bottom control to get moved outside the visible area... Just move the splitter back up. + if ((Context->Bottomitem->Rect.bottom - Context->Bottomitem->Rect.top) <= 100) + Context->SplitterPosition = Context->Topitem->Rect.bottom - Context->Topitem->Rect.top - SPLITTER_PADDING; // Set the bottom margin of the top control. Context->Topitem->Margin.bottom = Height - Context->SplitterPosition - SPLITTER_PADDING;