ToolStatus: Improve rebar menu redrawing, Fix rebar position changes when there are multiple menu plugins

This commit is contained in:
dmex
2021-08-28 03:27:35 +10:00
parent 6398a0c765
commit 4c55d9e91b
2 changed files with 16 additions and 6 deletions
+15 -5
View File
@@ -412,15 +412,25 @@ VOID NTAPI LayoutPaddingCallback(
if (RebarHandle && ToolStatusConfig.ToolBarEnabled)
{
RECT rebarRect;
//RECT clientRect;
RECT clientRect;
//INT x, y, cx, cy;
SendMessage(RebarHandle, WM_SIZE, 0, 0);
// TODO: GetClientRect with PhMainWndHandle causes crash.
//GetClientRect(PhMainWndHandle, &clientRect);
GetClientRect(PhMainWindowHandle, &clientRect);
GetClientRect(RebarHandle, &rebarRect);
//SendMessage(RebarHandle, WM_SIZE, 0, 0);
SetWindowPos(
RebarHandle,
NULL,
rebarRect.left,
layoutPadding->Padding.top,
clientRect.right - clientRect.left,
rebarRect.bottom - rebarRect.top,
SWP_NOACTIVATE | SWP_NOZORDER
);
UpdateWindow(RebarHandle);
// Adjust the PH client area and exclude the rebar width.
layoutPadding->Padding.top += rebarRect.bottom;
+1 -1
View File
@@ -129,7 +129,7 @@ VOID RebarLoadSettings(
WS_EX_TOOLWINDOW,
REBARCLASSNAME,
NULL,
WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CCS_NODIVIDER | CCS_TOP | RBS_VARHEIGHT, // | RBS_AUTOSIZE CCS_NOPARENTALIGN
WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CCS_NODIVIDER | CCS_NOPARENTALIGN | RBS_VARHEIGHT | RBS_AUTOSIZE, // | RBS_AUTOSIZE | CCS_TOP
0, 0, 0, 0,
PhMainWndHandle,
NULL,