mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-01 23:38:39 +02:00
TPanel: fix csOpaque style inconsistency (it depended on the order of ParentColor/ParentBackground change)
This commit is contained in:
parent
7d00a524a4
commit
96291eb9a5
@ -77,11 +77,8 @@ procedure TCustomPanel.SetParentBackground(const AParentBackground: Boolean);
|
|||||||
begin
|
begin
|
||||||
if ParentBackground=AParentBackground then
|
if ParentBackground=AParentBackground then
|
||||||
Exit;
|
Exit;
|
||||||
if AParentBackground then
|
|
||||||
ControlStyle := ControlStyle - [csOpaque]
|
|
||||||
else
|
|
||||||
ControlStyle := ControlStyle + [csOpaque];
|
|
||||||
inherited;
|
inherited;
|
||||||
|
UpdateParentColorChange;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomPanel.SetShowAccelChar(const Value: Boolean);
|
procedure TCustomPanel.SetShowAccelChar(const Value: Boolean);
|
||||||
@ -220,7 +217,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomPanel.UpdateParentColorChange;
|
procedure TCustomPanel.UpdateParentColorChange;
|
||||||
begin
|
begin
|
||||||
if ParentColor then
|
if ParentColor or ParentBackground then
|
||||||
ControlStyle := ControlStyle - [csOpaque]
|
ControlStyle := ControlStyle - [csOpaque]
|
||||||
else
|
else
|
||||||
ControlStyle := ControlStyle + [csOpaque];
|
ControlStyle := ControlStyle + [csOpaque];
|
||||||
|
Loading…
Reference in New Issue
Block a user