mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 09:58:27 +02:00
Revert "lcl: label: change left when making label visible for right-aligned autosized label. issue #21898"
This reverts commit 369b6b255e
.
This commit is contained in:
parent
fbe348a264
commit
f1b3d0ca11
@ -262,29 +262,6 @@ begin
|
|||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLabel.SetVisible(Value: Boolean);
|
|
||||||
var
|
|
||||||
OldWidth, OldLeft: Integer;
|
|
||||||
begin
|
|
||||||
// when changing to Visible, the width gets updated, check for right aligment and change left just like it is done in UpdateSize
|
|
||||||
// see issue #21898
|
|
||||||
if Value and not Visible then
|
|
||||||
begin
|
|
||||||
OldWidth := Width;
|
|
||||||
OldLeft := Left;
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
OldWidth := -1;
|
|
||||||
OldLeft := -1;
|
|
||||||
end;
|
|
||||||
|
|
||||||
inherited SetVisible(Value);
|
|
||||||
|
|
||||||
if (OldWidth>=0) and (AutoSize or OptimalFill) and (Alignment=taRightJustify)
|
|
||||||
and (OldWidth<>Width) and (OldLeft=Left) then
|
|
||||||
Left := Left-Width+OldWidth;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TCustomLabel.SetWordWrap
|
Method: TCustomLabel.SetWordWrap
|
||||||
Params: None
|
Params: None
|
||||||
|
@ -1598,7 +1598,6 @@ type
|
|||||||
procedure SetWordWrap(Value: Boolean);
|
procedure SetWordWrap(Value: Boolean);
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
procedure UpdateSize;
|
procedure UpdateSize;
|
||||||
procedure SetVisible(Value: Boolean); override;
|
|
||||||
|
|
||||||
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
|
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
|
||||||
property FocusControl: TWinControl read FFocusControl write SetFocusControl;
|
property FocusControl: TWinControl read FFocusControl write SetFocusControl;
|
||||||
|
Loading…
Reference in New Issue
Block a user