mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 19:29:25 +02:00
Win32: clear cached data on themechange. Patch by Anton Kavalenka. Resolves issue #40085.
This commit is contained in:
parent
727ea7ca57
commit
b16ec6790f
@ -153,7 +153,7 @@ const
|
||||
{ TWin32ThemeServices }
|
||||
|
||||
procedure TWin32ThemeServices.UnloadThemeData;
|
||||
procedure _Unload(_Theme: TThemeData);
|
||||
procedure _Unload(var _Theme: TThemeData);
|
||||
var
|
||||
Entry: TThemedElement;
|
||||
begin
|
||||
@ -165,11 +165,11 @@ procedure TWin32ThemeServices.UnloadThemeData;
|
||||
end;
|
||||
end;
|
||||
var
|
||||
E: TThemePPIDataEntry;
|
||||
i:integer;
|
||||
begin
|
||||
_Unload(FThemeData);
|
||||
for E in FThemePPIData do
|
||||
_Unload(E.Data);
|
||||
for i:=low(FThemePPIData) to high(FThemePPIData) do
|
||||
_Unload(FThemePPIData[I].Data);
|
||||
FThemePPIData := nil;
|
||||
end;
|
||||
|
||||
@ -429,10 +429,17 @@ begin
|
||||
end;
|
||||
|
||||
function TWin32ThemeServices.ContentRect(DC: HDC; Details: TThemedElementDetails; BoundingRect: TRect): TRect;
|
||||
var
|
||||
tmpr:TRect;
|
||||
begin
|
||||
if ThemesEnabled then
|
||||
begin
|
||||
with Details do
|
||||
GetThemeBackgroundContentRect(Theme[Element], DC, Part, State, BoundingRect, @Result)
|
||||
if GetThemeBackgroundContentRect(Theme[Element], DC, Part, State, BoundingRect, @tmpr)=S_OK then
|
||||
Result:=tmpr
|
||||
else
|
||||
Result := inherited;
|
||||
end
|
||||
else
|
||||
Result := inherited;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user