Fix themed tab invalidate
@@ -1042,8 +1042,7 @@ LRESULT CALLBACK PhpThemeWindowDrawButton(
DI_NORMAL
);
}
- else
- {
+
DrawText(
DrawInfo->hdc,
buttonText->Buffer,
@@ -1052,7 +1051,6 @@ LRESULT CALLBACK PhpThemeWindowDrawButton(
DT_CENTER | DT_SINGLELINE | DT_VCENTER | DT_HIDEPREFIX
);
}
- }
PhDereferenceObject(buttonText);
}
@@ -1710,11 +1708,15 @@ LRESULT CALLBACK PhpThemeWindowTabControlWndSubclassProc(
RECT clientRect;
PAINTSTRUCT ps;
- BeginPaint(WindowHandle, &ps);
+ if (!BeginPaint(WindowHandle, &ps))
+ break;
GetWindowRect(WindowHandle, &windowRect);
GetClientRect(WindowHandle, &clientRect);
+ TabCtrl_AdjustRect(WindowHandle, FALSE, &clientRect); // Make sure we don't paint in the client area.
+ ExcludeClipRect(ps.hdc, clientRect.left, clientRect.top, clientRect.right, clientRect.bottom);
+
windowRect.right -= windowRect.left;
windowRect.bottom -= windowRect.top;
windowRect.left = 0;
