mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 11:59:08 +02:00
IDE: added minimum font height of 6
git-svn-id: trunk@15792 -
This commit is contained in:
parent
2bc8e3e329
commit
f70b98cbb8
@ -1570,6 +1570,8 @@ begin
|
|||||||
XMLConfig.GetValue('EditorOptions/Display/EditorFont', 'courier');
|
XMLConfig.GetValue('EditorOptions/Display/EditorFont', 'courier');
|
||||||
fEditorFontHeight :=
|
fEditorFontHeight :=
|
||||||
XMLConfig.GetValue('EditorOptions/Display/EditorFontHeight', 12);
|
XMLConfig.GetValue('EditorOptions/Display/EditorFontHeight', 12);
|
||||||
|
if fEditorFontHeight<=0 then
|
||||||
|
fEditorFontHeight:=12;
|
||||||
fExtraCharSpacing :=
|
fExtraCharSpacing :=
|
||||||
XMLConfig.GetValue('EditorOptions/Display/ExtraCharSpacing', 0);
|
XMLConfig.GetValue('EditorOptions/Display/ExtraCharSpacing', 0);
|
||||||
fExtraLineSpacing :=
|
fExtraLineSpacing :=
|
||||||
@ -2659,13 +2661,17 @@ end;
|
|||||||
procedure TEditorOptionsForm.EditorFontButtonClick(Sender: TObject);
|
procedure TEditorOptionsForm.EditorFontButtonClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
FontDialog: TFontDialog;
|
FontDialog: TFontDialog;
|
||||||
|
NewHeight: LongInt;
|
||||||
begin
|
begin
|
||||||
FontDialog := TFontDialog.Create(Nil);
|
FontDialog := TFontDialog.Create(Nil);
|
||||||
try
|
try
|
||||||
with FontDialog do
|
with FontDialog do
|
||||||
begin
|
begin
|
||||||
Font.Name := EditorFontComboBox.Text;
|
Font.Name := EditorFontComboBox.Text;
|
||||||
Font.Height := StrToIntDef(EditorFontHeightComboBox.Text, PreviewEdits[1].Font.Height);
|
NewHeight := StrToIntDef(EditorFontHeightComboBox.Text, PreviewEdits[1].Font.Height);
|
||||||
|
if NewHeight<=0 then
|
||||||
|
NewHeight:=12;
|
||||||
|
Font.Height := NewHeight;
|
||||||
Options := Options + [fdApplyButton];
|
Options := Options + [fdApplyButton];
|
||||||
OnApplyClicked := @FontDialogApplyClicked;
|
OnApplyClicked := @FontDialogApplyClicked;
|
||||||
if Execute then
|
if Execute then
|
||||||
@ -2721,16 +2727,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
NewVal := StrToIntDef(EditorFontHeightComboBox.Text,
|
NewVal := StrToIntDef(EditorFontHeightComboBox.Text,
|
||||||
PreviewEdits[1].Font.Height);
|
PreviewEdits[1].Font.Height);
|
||||||
if (NewVal < 0) then
|
if (NewVal <= 6) then
|
||||||
if (NewVal > -6) then
|
|
||||||
NewVal := -6;
|
|
||||||
if (NewVal >= 0) then
|
|
||||||
if (NewVal < 6) then
|
|
||||||
NewVal := 6;
|
NewVal := 6;
|
||||||
if (NewVal > 40) then
|
if (NewVal > 40) then
|
||||||
NewVal := 40;
|
NewVal := 40;
|
||||||
if (NewVal < -40) then
|
|
||||||
NewVal := -40;
|
|
||||||
SetComboBoxText(EditorFontHeightComboBox, IntToStr(NewVal));
|
SetComboBoxText(EditorFontHeightComboBox, IntToStr(NewVal));
|
||||||
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
||||||
if PreviewEdits[a] <> Nil then
|
if PreviewEdits[a] <> Nil then
|
||||||
@ -3570,8 +3570,7 @@ begin
|
|||||||
EditorFontLabel.Caption := dlgEditorFont;
|
EditorFontLabel.Caption := dlgEditorFont;
|
||||||
|
|
||||||
with EditorFontHeightComboBox do
|
with EditorFontHeightComboBox do
|
||||||
SetComboBoxText(EditorFontHeightComboBox
|
SetComboBoxText(EditorFontHeightComboBox,IntToStr(EditorOpts.EditorFontHeight));
|
||||||
, IntToStr(EditorOpts.EditorFontHeight));
|
|
||||||
|
|
||||||
EditorFontHeightLabel.Caption := dlgEditorFontHeight;
|
EditorFontHeightLabel.Caption := dlgEditorFontHeight;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user