Skip to content

Commit 4215aee

Browse files
committed
enhance: reduce width of left gutter in popup text editor
1 parent 230ac8d commit 4215aee

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

source/texteditor.lfm

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ object frmTextEditor: TfrmTextEditor
1010
Constraints.MinHeight = 125
1111
Constraints.MinWidth = 375
1212
DesignTimePPI = 120
13+
Position = poMainFormCenter
1314
OnClose = FormClose
1415
OnCreate = FormCreate
1516
OnDestroy = FormDestroy
1617
OnShow = FormShow
17-
Position = poMainFormCenter
1818
object Panel1: TPanel
1919
Left = 0
2020
Height = 40
@@ -138,8 +138,8 @@ object frmTextEditor: TfrmTextEditor
138138
Caption = 'Customize highlighter'
139139
DropdownMenu = popupHighlighter
140140
ImageIndex = 39
141-
OnClick = btnCustomizeHighlighterClick
142141
Style = tbsDropDown
142+
OnClick = btnCustomizeHighlighterClick
143143
end
144144
end
145145
object comboHighlighter: TComboBox
@@ -182,7 +182,7 @@ object frmTextEditor: TfrmTextEditor
182182
TabOrder = 1
183183
OnClick = MemoTextClick
184184
OnKeyDown = MemoTextKeyDown
185-
Gutter.Width = 72
185+
Gutter.Width = 71
186186
Gutter.MouseActions = <>
187187
RightGutter.Width = 0
188188
RightGutter.MouseActions = <>
@@ -223,9 +223,10 @@ object frmTextEditor: TfrmTextEditor
223223
end
224224
object SynGutterLineNumber1: TSynGutterLineNumber
225225
Width = 21
226+
LeftOffset = 2
226227
MouseActions = <>
227228
MarkupInfo.Background = clBtnFace
228-
MarkupInfo.Foreground = clNone
229+
MarkupInfo.Foreground = clGrayText
229230
DigitCount = 2
230231
ShowOnlyLineNumbersMultiplesOf = 1
231232
ZeroStart = False
@@ -237,12 +238,6 @@ object frmTextEditor: TfrmTextEditor
237238
ModifiedColor = 59900
238239
SavedColor = clGreen
239240
end
240-
object SynGutterSeparator1: TSynGutterSeparator
241-
Width = 3
242-
MouseActions = <>
243-
MarkupInfo.Background = clWhite
244-
MarkupInfo.Foreground = clGray
245-
end
246241
object SynGutterCodeFolding1: TSynGutterCodeFolding
247242
Width = 13
248243
MouseActions = <>

source/texteditor.pas

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface
66

77
uses
88
Classes, Graphics, Forms, Controls, StdCtrls, laz.VirtualTrees,
9-
ComCtrls, Dialogs, SysUtils, Menus, LCLType,
9+
ComCtrls, Dialogs, SysUtils, Menus, LCLType, SynGutterCodeFolding,
1010
apphelpers, ActnList, extra_controls,
1111
ExtCtrls, dbconnection, SynEdit, SynEditHighlighter, customize_highlighter,
1212
Laz2_DOM, Laz2_XMLRead, Laz2_XMLWrite,
@@ -240,6 +240,7 @@ procedure TfrmTextEditor.FormCreate(Sender: TObject);
240240
var
241241
Highlighters: TSynHighlighterList;
242242
i: Integer;
243+
CodeFoldingPart: TSynGutterCodeFolding;
243244
begin
244245
HasSizeGrip := True;
245246
FClosingByApplyButton := False;
@@ -272,6 +273,10 @@ procedure TfrmTextEditor.FormCreate(Sender: TObject);
272273
MemoText.Options := MainForm.SynMemoQuery.Options;
273274
MemoText.Options2 := MainForm.SynMemoQuery.Options2;
274275
MemoText.Keystrokes := MainForm.SynMemoQuery.Keystrokes;
276+
CodeFoldingPart := MemoText.Gutter.CodeFoldPart(0);
277+
if Assigned(CodeFoldingPart) then begin
278+
CodeFoldingPart.Visible := MainForm.actCodeFolding.Checked;
279+
end;
275280
if AppSettings.ReadBool(asMemoEditorMaximized) then
276281
WindowState := wsMaximized;
277282
// Restore form dimensions

0 commit comments

Comments
 (0)