Minimap: improved config frame layout, i18n-ed

This commit is contained in:
Maxim Ganetsky 2024-09-30 19:49:51 +03:00
parent 66b94d7af1
commit 1925dbb6c2
5 changed files with 114 additions and 77 deletions

View File

@ -9,41 +9,40 @@ object MiniMapConfigFrame: TMiniMapConfigFrame
DesignLeft = 652
DesignTop = 343
object cbEnabled: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 152
Left = 8
Height = 23
Top = 8
Width = 123
Width = 112
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Show minimap'
TabOrder = 0
end
object lblMapWidth: TLabel
AnchorSideTop.Control = seWidth
AnchorSideRight.Control = seWidth
AnchorSideBottom.Control = seWidth
AnchorSideLeft.Control = cbAlignLeft
AnchorSideTop.Control = cbAlignLeft
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 16
Height = 34
Left = 8
Height = 16
Top = 70
Width = 128
Width = 60
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight, akBottom]
AutoSize = False
BorderSpacing.Right = 8
BorderSpacing.Top = 8
Caption = 'Map width'
FocusControl = seWidth
Layout = tlCenter
end
object seWidth: TSpinEditEx
AnchorSideLeft.Control = cbEnabled
AnchorSideTop.Control = cbAlignLeft
AnchorSideLeft.Control = lblMapWidth
AnchorSideTop.Control = lblMapWidth
AnchorSideTop.Side = asrBottom
Left = 152
Height = 34
Top = 70
Width = 64
BorderSpacing.Top = 8
Left = 8
Height = 33
Top = 86
Width = 80
MaxLength = 0
SpinButtonWidth = 17
TabOrder = 1
@ -53,14 +52,13 @@ object MiniMapConfigFrame: TMiniMapConfigFrame
Value = 100
end
object seInitialFontSize: TSpinEditEx
AnchorSideLeft.Control = cbEnabled
AnchorSideTop.Control = seWidth
AnchorSideLeft.Control = lblInitialFontSize
AnchorSideTop.Control = lblInitialFontSize
AnchorSideTop.Side = asrBottom
Left = 152
Height = 34
Top = 112
Width = 60
BorderSpacing.Top = 8
Left = 8
Height = 33
Top = 143
Width = 80
MaxLength = 0
SpinButtonWidth = 17
TabOrder = 2
@ -70,79 +68,71 @@ object MiniMapConfigFrame: TMiniMapConfigFrame
Value = 1
end
object lblInitialFontSize: TLabel
AnchorSideTop.Control = seInitialFontSize
AnchorSideRight.Control = seInitialFontSize
AnchorSideBottom.Control = seInitialFontSize
AnchorSideLeft.Control = seWidth
AnchorSideTop.Control = seWidth
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 16
Height = 34
Top = 112
Width = 128
Left = 8
Height = 16
Top = 127
Width = 85
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight, akBottom]
AutoSize = False
BorderSpacing.Right = 8
BorderSpacing.Top = 8
Caption = 'Initial font size'
FocusControl = seInitialFontSize
Layout = tlCenter
end
object cbViewWindow: TColorBox
AnchorSideLeft.Control = cbEnabled
AnchorSideTop.Control = seInitialFontSize
AnchorSideLeft.Control = lblViewWindowColor
AnchorSideTop.Control = lblViewWindowColor
AnchorSideTop.Side = asrBottom
Left = 152
Height = 29
Top = 154
Width = 128
Left = 8
Height = 28
Top = 200
Width = 235
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeNone, cbCustomColor]
ColorDialog = CDView
BorderSpacing.Top = 8
ItemHeight = 0
TabOrder = 3
end
object lblViewWindowColor: TLabel
AnchorSideTop.Control = cbViewWindow
AnchorSideRight.Control = cbViewWindow
AnchorSideBottom.Control = cbViewWindow
AnchorSideLeft.Control = seInitialFontSize
AnchorSideTop.Control = seInitialFontSize
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 16
Height = 29
Top = 154
Width = 125
Left = 8
Height = 16
Top = 184
Width = 109
Alignment = taRightJustify
Anchors = [akTop, akLeft, akBottom]
AutoSize = False
BorderSpacing.Right = 8
BorderSpacing.Top = 8
Caption = 'View window color'
Layout = tlCenter
end
object lblViewWindowTextColor: TLabel
AnchorSideTop.Control = cbViewText
AnchorSideRight.Control = cbViewText
AnchorSideBottom.Control = cbViewText
AnchorSideLeft.Control = cbViewWindow
AnchorSideTop.Control = cbViewWindow
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 16
Height = 29
Top = 191
Width = 128
Left = 8
Height = 16
Top = 236
Width = 87
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight, akBottom]
AutoSize = False
BorderSpacing.Right = 8
BorderSpacing.Top = 8
Caption = 'View text color'
Layout = tlCenter
end
object cbViewText: TColorBox
AnchorSideLeft.Control = cbEnabled
AnchorSideTop.Control = cbViewWindow
AnchorSideLeft.Control = lblViewWindowTextColor
AnchorSideTop.Control = lblViewWindowTextColor
AnchorSideTop.Side = asrBottom
Left = 152
Height = 29
Top = 191
Width = 123
Left = 8
Height = 28
Top = 252
Width = 235
Style = [cbStandardColors, cbSystemColors, cbIncludeNone, cbCustomColor]
ColorDialog = CDView
BorderSpacing.Top = 8
ItemHeight = 0
TabOrder = 4
end
@ -150,10 +140,10 @@ object MiniMapConfigFrame: TMiniMapConfigFrame
AnchorSideLeft.Control = cbEnabled
AnchorSideTop.Control = cbEnabled
AnchorSideTop.Side = asrBottom
Left = 152
Left = 8
Height = 23
Top = 39
Width = 428
Width = 371
BorderSpacing.Top = 8
Caption = 'Put map left of editor (requires IDE restart for existing tabs)'
TabOrder = 5
@ -182,7 +172,7 @@ object MiniMapConfigFrame: TMiniMapConfigFrame
'ColorS=F0FBFF'
'ColorT=A4A0A0'
)
Left = 301
Top = 124
Left = 288
Top = 96
end
end

View File

@ -52,12 +52,17 @@ uses CtrlMiniMap, StrMiniMap;
function TMiniMapConfigFrame.GetTitle: String;
begin
Result:=SMinimapConfigTitle
Result:=SMinimapConfigTitle;
end;
procedure TMiniMapConfigFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
begin
// nothing
cbEnabled.Caption:=SShowMinimap;
cbAlignLeft.Caption:=SPutMapLeftOfEditorRe;
lblMapWidth.Caption:=SMapWidth;
lblInitialFontSize.Caption:=SInitialFontSize;
lblViewWindowColor.Caption:=SViewWindowColor;
lblViewWindowTextColor.Caption:=SViewWindowTextColor;
end;
procedure TMiniMapConfigFrame.ReadSettings(AOptions: TAbstractIDEOptions);

View File

@ -0,0 +1,31 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: strminimap.sinitialfontsize
msgid "Initial font size"
msgstr ""
#: strminimap.smapwidth
msgid "Minimap width"
msgstr ""
#: strminimap.sminimapconfigtitle
msgid "Minimap"
msgstr ""
#: strminimap.sputmapleftofeditorre
msgid "Put minimap left of editor (requires IDE restart for existing tabs)"
msgstr ""
#: strminimap.sshowminimap
msgid "Show minimap"
msgstr ""
#: strminimap.sviewwindowcolor
msgid "View window color"
msgstr ""
#: strminimap.sviewwindowtextcolor
msgid "View window text color"
msgstr ""

View File

@ -37,6 +37,10 @@
<UnitName Value="CtrlMiniMap"/>
</Item>
</Files>
<i18n>
<EnableI18N Value="True"/>
<OutDir Value="languages"/>
</i18n>
<RequiredPkgs>
<Item>
<PackageName Value="LazControlDsgn"/>

View File

@ -14,8 +14,15 @@ const
KeyViewWindowTextColor = 'ViewWindowTextColor';
KeyInitialFontSize = 'InitialFontSize';
Resourcestring
SMinimapConfigTitle = 'MiniMap';
resourcestring
SMinimapConfigTitle = 'Minimap';
SShowMinimap = 'Show minimap';
SPutMapLeftOfEditorRe = 'Put minimap left of editor (requires IDE restart for '
+'existing tabs)';
SMapWidth = 'Minimap width';
SInitialFontSize = 'Initial font size';
SViewWindowColor = 'View window color';
SViewWindowTextColor = 'View window text color';
implementation