mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 15:56:00 +02:00
SynEdit Gutter: Fixing some AutoSize stuff
git-svn-id: trunk@18364 -
This commit is contained in:
parent
87ca389d26
commit
3fe186c1da
@ -118,6 +118,7 @@ type
|
||||
FOnGutterClick: TGutterClickEvent;
|
||||
function GetGutterParts: TSynGutterPartList;
|
||||
procedure SetMarkupInfo(const AValue: TSynSelectedColor);
|
||||
procedure SetRealWidth(const AValue: Integer);
|
||||
protected
|
||||
FWidth : integer;
|
||||
procedure SetAutoSize(const AValue : boolean); virtual;
|
||||
@ -127,6 +128,7 @@ type
|
||||
property GutterParts: TSynGutterPartList read GetGutterParts;
|
||||
property Gutter: TSynGutter read FGutter;
|
||||
property SynEdit:TSynEditBase read FSynEdit;
|
||||
property RealWidth: Integer write SetRealWidth;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -600,8 +602,10 @@ end;
|
||||
|
||||
procedure TSynGutter.SetWidth(Value: integer);
|
||||
begin
|
||||
if FAutoSize then
|
||||
Value := RealGutterWidth(FTextDrawer.CharWidth);
|
||||
Value := Max(0, Value);
|
||||
if (FWidth <> Value) and not FAutoSize then
|
||||
if (FWidth <> Value) then
|
||||
begin
|
||||
FWidth := Value;
|
||||
DoChange(Self);
|
||||
@ -728,6 +732,13 @@ begin
|
||||
FMarkupInfo.Assign(AValue);
|
||||
end;
|
||||
|
||||
procedure TSynGutterPartBase.SetRealWidth(const AValue: Integer);
|
||||
begin
|
||||
if FWidth = AValue then exit;
|
||||
FWidth := AValue;
|
||||
DoChange(self);
|
||||
end;
|
||||
|
||||
procedure TSynGutterPartBase.SetAutoSize(const AValue : boolean);
|
||||
begin
|
||||
if FAutoSize=AValue then exit;
|
||||
|
@ -90,7 +90,7 @@ begin
|
||||
end;
|
||||
|
||||
if AutoSize then
|
||||
Width := 4;
|
||||
RealWidth := 4;
|
||||
Result := Width;
|
||||
end;
|
||||
|
||||
|
@ -136,7 +136,7 @@ begin
|
||||
end;
|
||||
|
||||
if AutoSize then
|
||||
FWidth := FAutoSizeDigitCount * CharWidth + 1;
|
||||
RealWidth := FAutoSizeDigitCount * CharWidth + 1;
|
||||
Result := Width;
|
||||
end;
|
||||
|
||||
@ -153,8 +153,12 @@ begin
|
||||
FAutoSizeDigitCount := nDigits;
|
||||
DoChange(Self);
|
||||
end;
|
||||
end else
|
||||
end
|
||||
else
|
||||
if FAutoSizeDigitCount <> FDigitCount then begin
|
||||
FAutoSizeDigitCount := FDigitCount;
|
||||
DoChange(Self);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSynGutterLineNumber.FormatLineNumber(Line: integer; IsDot: boolean): string;
|
||||
|
Loading…
Reference in New Issue
Block a user