Qt: optimized palette reload instead of recreating handles. issue #38589

(cherry picked from commit 9233efadf0)
This commit is contained in:
Željan Rikalo 2021-10-12 12:37:48 +02:00 committed by Maxim Ganetsky
parent 86db9c2719
commit 927f2884d3
2 changed files with 8 additions and 11 deletions

View File

@ -932,17 +932,6 @@ begin
begin
ClearCachedColors;
FreeSysColorBrushes(True);
end else
begin
if QObject_isWidgetType(Sender) then
begin
W := QtObjectFromWidgetH(QWidgetH(Sender));
if (W <> nil) and Assigned(W.LCLObject) and W.IsWindow then
begin
RecreateWnd(W.LCLObject);
Result := True;
end;
end;
end;
end;
QEventShow,

View File

@ -2691,6 +2691,14 @@ begin
begin
if (FPalette <> nil) and not InUpdate and not Palette.InReload then
begin
// issue #38589
if (QEvent_type(Event) = QEventPaletteChange) then
begin
FPalette.Free;
FPalette := nil;
GetPalette;
end;
OldColor := Palette.CurrentColor;
// now set our fpalette ColorRef from LCL
if LCLObject.Color <> clDefault then