mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 15:56:00 +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;
|
||||||
@ -424,8 +425,20 @@ begin
|
|||||||
|
|
||||||
if FWidth = NewWidth then exit;
|
if FWidth = NewWidth then exit;
|
||||||
|
|
||||||
|
IncChangeLock;
|
||||||
|
try
|
||||||
FWidth := NewWidth;
|
FWidth := NewWidth;
|
||||||
|
Include(FFlags, gfNeedChildBounds);
|
||||||
|
|
||||||
|
RecalcBounds;
|
||||||
|
|
||||||
|
if gfNeedChildBounds in FFlags then
|
||||||
|
SetChildBounds;
|
||||||
|
|
||||||
DoResize(Self);
|
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