mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 00:39:49 +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:
|
WM_PAINT:
|
||||||
begin
|
begin
|
||||||
WindowInfo := GetWin32WindowInfo(Window);
|
WindowInfo := GetWin32WindowInfo(Window);
|
||||||
if ThemeServices.ThemesEnabled and Assigned(WindowInfo) and (WindowInfo^.WinControl is TCustomStaticText)
|
// Workaround for disabled StaticText not being grayed at designtime
|
||||||
and not TCustomStaticText(WindowInfo^.WinControl).Enabled then
|
if ThemeServices.ThemesEnabled and Assigned(WindowInfo) and
|
||||||
|
(WindowInfo^.WinControl is TCustomStaticText)
|
||||||
|
and not TCustomStaticText(WindowInfo^.WinControl).Enabled then
|
||||||
begin
|
begin
|
||||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||||
StaticText := TCustomStaticText(WindowInfo^.WinControl);
|
StaticText := TCustomStaticText(WindowInfo^.WinControl);
|
||||||
|
if not (csDesigning in StaticText.ComponentState) then
|
||||||
|
exit;
|
||||||
|
|
||||||
DC := GetDC(Window);
|
DC := GetDC(Window);
|
||||||
SetBkColor(DC, GetSysColor(COLOR_BTNFACE));
|
SetBkMode(DC, TRANSPARENT);
|
||||||
SetTextColor(DC, GetSysColor(COLOR_GRAYTEXT));
|
SetTextColor(DC, GetSysColor(COLOR_GRAYTEXT));
|
||||||
SelectObject(DC, StaticText.Font.Reference.Handle);
|
SelectObject(DC, StaticText.Font.Reference.Handle);
|
||||||
Flags := 0;
|
Flags := 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user