Commit 274d3e6e authored by Michael W. Vogel's avatar Michael W. Vogel
Browse files

LCL: Win32: Fixed themed drawing for system font usage. Issue #32319

git-svn-id: trunk@55758 -
parent ec8f0f7e
......@@ -506,6 +506,21 @@ procedure TWin32ThemeServices.DrawText(ACanvas: TPersistent;
var
FontUnderlineSave:boolean;
DC: HDC;
DCIndex: Integer;
ARect: TRect;
procedure SaveState;
begin
if DCIndex <> 0 then exit;
DCIndex := SaveDC(DC);
end;
procedure RestoreState;
begin
if DCIndex = 0 then exit;
RestoreDC(DC, DCIndex);
end;
function NotImplementedInXP: Boolean; inline;
begin
......@@ -532,7 +547,16 @@ begin
// to fix it here with disabled button text
if (Details.Element = teToolBar) and (Details.State = TS_DISABLED) then
Details := GetElementDetails(tbPushButtonDisabled);
DrawText(TCanvas(ACanvas).Handle, Details, S, R, Flags, Flags2);
DCIndex := 0;
DC := TCanvas(ACanvas).Handle;
if TCanvas(ACanvas).Font.IsDefault then
begin
SaveState;
SelectObject(DC, OnGetSystemFont());
end;
DrawText(DC, Details, S, R, Flags, Flags2);
RestoreState;
end
else
inherited;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment