mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-21 10:20:38 +01: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 }
|
{ TWin32ThemeServices }
|
||||||
|
|
||||||
procedure TWin32ThemeServices.UnloadThemeData;
|
procedure TWin32ThemeServices.UnloadThemeData;
|
||||||
procedure _Unload(_Theme: TThemeData);
|
procedure _Unload(var _Theme: TThemeData);
|
||||||
var
|
var
|
||||||
Entry: TThemedElement;
|
Entry: TThemedElement;
|
||||||
begin
|
begin
|
||||||
@ -165,11 +165,11 @@ procedure TWin32ThemeServices.UnloadThemeData;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
var
|
var
|
||||||
E: TThemePPIDataEntry;
|
i:integer;
|
||||||
begin
|
begin
|
||||||
_Unload(FThemeData);
|
_Unload(FThemeData);
|
||||||
for E in FThemePPIData do
|
for i:=low(FThemePPIData) to high(FThemePPIData) do
|
||||||
_Unload(E.Data);
|
_Unload(FThemePPIData[I].Data);
|
||||||
FThemePPIData := nil;
|
FThemePPIData := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -429,10 +429,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TWin32ThemeServices.ContentRect(DC: HDC; Details: TThemedElementDetails; BoundingRect: TRect): TRect;
|
function TWin32ThemeServices.ContentRect(DC: HDC; Details: TThemedElementDetails; BoundingRect: TRect): TRect;
|
||||||
|
var
|
||||||
|
tmpr:TRect;
|
||||||
begin
|
begin
|
||||||
if ThemesEnabled then
|
if ThemesEnabled then
|
||||||
|
begin
|
||||||
with Details do
|
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
|
else
|
||||||
Result := inherited;
|
Result := inherited;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user