mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 17:46:07 +02:00
SynEdit: Fixed gutter resizing. Issue #0023990
git-svn-id: trunk@40545 -
This commit is contained in:
parent
939420b860
commit
526c404fd7
@ -35,6 +35,7 @@ type
|
|||||||
FInDoChange: Boolean;
|
FInDoChange: Boolean;
|
||||||
FChangeLock: Integer;
|
FChangeLock: Integer;
|
||||||
FNeedOnChange, FNeedOnResize: Boolean;
|
FNeedOnChange, FNeedOnResize: Boolean;
|
||||||
|
FFlags: set of (gfNeedChildBounds);
|
||||||
FOnResize: TNotifyEvent;
|
FOnResize: TNotifyEvent;
|
||||||
FOnChange: TNotifyEvent;
|
FOnChange: TNotifyEvent;
|
||||||
FMouseActions: TSynEditMouseInternalActions;
|
FMouseActions: TSynEditMouseInternalActions;
|
||||||
@ -84,7 +85,7 @@ type
|
|||||||
property Side:TSynGutterSide read FSide;
|
property Side:TSynGutterSide read FSide;
|
||||||
property AutoSize: boolean read FAutoSize write SetAutoSize default True;
|
property AutoSize: boolean read FAutoSize write SetAutoSize default True;
|
||||||
property Visible: boolean read FVisible write SetVisible default True;
|
property Visible: boolean read FVisible write SetVisible default True;
|
||||||
property LeftOffset: integer read FLeftOffset write SetLeftOffset
|
property LeftOffset: integer read FLeftOffset write SetLeftOffset
|
||||||
default 0;
|
default 0;
|
||||||
property RightOffset: integer read FRightOffset write SetRightOffset
|
property RightOffset: integer read FRightOffset write SetRightOffset
|
||||||
default 0;
|
default 0;
|
||||||
@ -424,8 +425,20 @@ begin
|
|||||||
|
|
||||||
if FWidth = NewWidth then exit;
|
if FWidth = NewWidth then exit;
|
||||||
|
|
||||||
FWidth := NewWidth;
|
IncChangeLock;
|
||||||
DoResize(Self);
|
try
|
||||||
|
FWidth := NewWidth;
|
||||||
|
Include(FFlags, gfNeedChildBounds);
|
||||||
|
|
||||||
|
RecalcBounds;
|
||||||
|
|
||||||
|
if gfNeedChildBounds in FFlags then
|
||||||
|
SetChildBounds;
|
||||||
|
|
||||||
|
DoResize(Self);
|
||||||
|
finally
|
||||||
|
DecChangeLock;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynGutterBase.SetChildBounds;
|
procedure TSynGutterBase.SetChildBounds;
|
||||||
@ -438,6 +451,7 @@ begin
|
|||||||
Parts[i].SetBounds(NewLeft, Top, Height);
|
Parts[i].SetBounds(NewLeft, Top, Height);
|
||||||
NewLeft := NewLeft + Parts[i].Width;
|
NewLeft := NewLeft + Parts[i].Width;
|
||||||
end;
|
end;
|
||||||
|
Exclude(FFlags, gfNeedChildBounds);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynGutterBase.PartCount: integer;
|
function TSynGutterBase.PartCount: integer;
|
||||||
@ -658,7 +672,6 @@ begin
|
|||||||
try
|
try
|
||||||
if Gutter.AutoSize then
|
if Gutter.AutoSize then
|
||||||
Gutter.DoAutoSize; // Calculate new total width of gutter
|
Gutter.DoAutoSize; // Calculate new total width of gutter
|
||||||
Gutter.RecalcBounds; // New Bounds (needs Gutter.Width) and call SetChildBounds
|
|
||||||
DoResize(Self);
|
DoResize(Self);
|
||||||
if aCallDoChange then
|
if aCallDoChange then
|
||||||
DoChange(Self);
|
DoChange(Self);
|
||||||
|
Loading…
Reference in New Issue
Block a user