Skip to content

Commit c3b0da6

Browse files
committed
Fix themed tab invalidate
1 parent ac3325a commit c3b0da6

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

phlib/theme.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,16 +1042,14 @@ LRESULT CALLBACK PhpThemeWindowDrawButton(
10421042
DI_NORMAL
10431043
);
10441044
}
1045-
else
1046-
{
1047-
DrawText(
1048-
DrawInfo->hdc,
1049-
buttonText->Buffer,
1050-
(UINT)buttonText->Length / sizeof(WCHAR),
1051-
&DrawInfo->rc,
1052-
DT_CENTER | DT_SINGLELINE | DT_VCENTER | DT_HIDEPREFIX
1053-
);
1054-
}
1045+
1046+
DrawText(
1047+
DrawInfo->hdc,
1048+
buttonText->Buffer,
1049+
(UINT)buttonText->Length / sizeof(WCHAR),
1050+
&DrawInfo->rc,
1051+
DT_CENTER | DT_SINGLELINE | DT_VCENTER | DT_HIDEPREFIX
1052+
);
10551053
}
10561054

10571055
PhDereferenceObject(buttonText);
@@ -1710,11 +1708,15 @@ LRESULT CALLBACK PhpThemeWindowTabControlWndSubclassProc(
17101708
RECT clientRect;
17111709
PAINTSTRUCT ps;
17121710

1713-
BeginPaint(WindowHandle, &ps);
1711+
if (!BeginPaint(WindowHandle, &ps))
1712+
break;
17141713

17151714
GetWindowRect(WindowHandle, &windowRect);
17161715
GetClientRect(WindowHandle, &clientRect);
17171716

1717+
TabCtrl_AdjustRect(WindowHandle, FALSE, &clientRect); // Make sure we don't paint in the client area.
1718+
ExcludeClipRect(ps.hdc, clientRect.left, clientRect.top, clientRect.right, clientRect.bottom);
1719+
17181720
windowRect.right -= windowRect.left;
17191721
windowRect.bottom -= windowRect.top;
17201722
windowRect.left = 0;

0 commit comments

Comments
 (0)