mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 23:39:24 +02:00
LCL/Win32: Fix disabled StaticText being drawn with opaque text background although Transparent is true.
git-svn-id: branches/fixes_2_0@63377 -
This commit is contained in:
parent
87a93ab40e
commit
a2f205657f
@ -1630,13 +1630,18 @@ begin
|
||||
WM_PAINT:
|
||||
begin
|
||||
WindowInfo := GetWin32WindowInfo(Window);
|
||||
if ThemeServices.ThemesEnabled and Assigned(WindowInfo) and (WindowInfo^.WinControl is TCustomStaticText)
|
||||
and not TCustomStaticText(WindowInfo^.WinControl).Enabled then
|
||||
// Workaround for disabled StaticText not being grayed at designtime
|
||||
if ThemeServices.ThemesEnabled and Assigned(WindowInfo) and
|
||||
(WindowInfo^.WinControl is TCustomStaticText)
|
||||
and not TCustomStaticText(WindowInfo^.WinControl).Enabled then
|
||||
begin
|
||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||
StaticText := TCustomStaticText(WindowInfo^.WinControl);
|
||||
if not (csDesigning in StaticText.ComponentState) then
|
||||
exit;
|
||||
|
||||
DC := GetDC(Window);
|
||||
SetBkColor(DC, GetSysColor(COLOR_BTNFACE));
|
||||
SetBkMode(DC, TRANSPARENT);
|
||||
SetTextColor(DC, GetSysColor(COLOR_GRAYTEXT));
|
||||
SelectObject(DC, StaticText.Font.Reference.Handle);
|
||||
Flags := 0;
|
||||
|
Loading…
Reference in New Issue
Block a user