Skip to content

Commit 48aaabb

Browse files
committed
fix: remove GUI font size setting from preferences, do not set font size in InheritFont
Closes #2580, closes #2588
1 parent 6229c50 commit 48aaabb

4 files changed

Lines changed: 5 additions & 52 deletions

File tree

‎source/apphelpers.pas‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ TWinControlHelper = class helper for TWinControl
220220
asPromptSaveFileOnTabClose, asRestoreTabs, asTabCloseOnDoubleClick, asTabCloseOnMiddleClick, asTabsInMultipleLines, asTabIconsGrayscaleMode,
221221
asWarnUnsafeUpdates, asQueryGridLongSortRowNum,
222222
asCompletionProposal, asCompletionProposalInterval, asCompletionProposalSearchOnMid, asCompletionProposalWidth, asCompletionProposalNbLinesInWindow, asAutoUppercase,
223-
asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize,
223+
asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName,
224224
asTheme, asIconPack, asWebSearchBaseUrl,
225225
asFindDialogReplaceHistory, asMaxQueryResults, asLogErrors,
226226
asLogUserSQL, asLogSQL, asLogInfos, asLogDebug, asLogScript, asLogTimestamp, asFieldColorNumeric,
@@ -4109,7 +4109,6 @@ constructor TAppSettings.Create;
41094109
InitSetting(asFindDialogSearchHistory, 'FindDialogSearchHistory', 0, False, '');
41104110
InitSetting(asFindDialogReplaceHistory, 'FindDialogReplaceHistory', 0, False, '');
41114111
InitSetting(asGUIFontName, 'GUIFontName', 0, False, '');
4112-
InitSetting(asGUIFontSize, 'GUIFontSize', 8);
41134112
InitSetting(asTheme, 'Theme', 0, False, 'Windows');
41144113
InitSetting(asIconPack, 'IconPack', 0, False, 'Icons8');
41154114
InitSetting(asWebSearchBaseUrl, 'WebSearchBaseUrl', 0, False, 'https://www.ecosia.org/search?q=%query');

‎source/extra_controls.pas‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,13 @@ class procedure TExtForm.InheritFont(AFont: TFont);
237237
GUIFontName: String;
238238
begin
239239
// Set custom font if set, or default system font.
240-
// In high-dpi mode, the font *size* is increased automatically somewhere in the VCL,
241-
// caused by a form's .Scaled property. So we don't increase it here again.
242-
// To test this, you really need to log off/on Windows!
240+
// The font *size* is deliberately not touched here: it is scaled by the VCL
241+
// according to the user's DPI (form scaling), and setting it again would
242+
// result in double enlargement. See issue #3204.
243243
GUIFontName := AppSettings.ReadString(asGUIFontName);
244244
if not GUIFontName.IsEmpty then begin
245245
// Apply user specified font
246246
AFont.Name := GUIFontName;
247-
// Set size on top of automatic dpi-increased size
248-
AFont.Size := AppSettings.ReadInt(asGUIFontSize);
249247
end else begin
250248
// Apply system font. See issue #3204.
251249
// Code taken from http://www.gerixsoft.com/blog/delphi/system-font

‎source/preferences.dfm‎

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ object frmPreferences: TfrmPreferences
6767
Height = 14
6868
Caption = 'GUI font: *'
6969
end
70-
object lblGUIFontSize: TLabel
71-
Left = 640
72-
Top = 258
73-
Width = 12
74-
Height = 14
75-
Anchors = [akTop, akRight]
76-
Caption = 'pt'
77-
end
7870
object lblTheme: TLabel
7971
Left = 8
8072
Top = 285
@@ -244,37 +236,13 @@ object frmPreferences: TfrmPreferences
244236
Tag = 1
245237
Left = 220
246238
Top = 255
247-
Width = 338
239+
Width = 451
248240
Height = 22
249241
Style = csDropDownList
250242
Anchors = [akLeft, akTop, akRight]
251243
TabOrder = 13
252244
OnChange = comboGUIFontChange
253245
end
254-
object editGUIFontSize: TEdit
255-
Tag = 1
256-
Left = 565
257-
Top = 255
258-
Width = 50
259-
Height = 22
260-
Anchors = [akTop, akRight]
261-
TabOrder = 14
262-
Text = '8'
263-
OnChange = Modified
264-
end
265-
object updownGUIFontSize: TUpDown
266-
Tag = 1
267-
Left = 615
268-
Top = 255
269-
Width = 16
270-
Height = 22
271-
Anchors = [akTop, akRight]
272-
Associate = editGUIFontSize
273-
Min = 4
274-
Position = 8
275-
TabOrder = 15
276-
OnChanging = anyUpDownLimitChanging
277-
end
278246
object chkWheelZoom: TCheckBox
279247
Left = 220
280248
Top = 123

‎source/preferences.pas‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ TfrmPreferences = class(TExtForm)
139139
comboLineBreakStyle: TComboBox;
140140
lblGUIFont: TLabel;
141141
comboGUIFont: TComboBox;
142-
editGUIFontSize: TEdit;
143-
updownGUIFontSize: TUpDown;
144-
lblGUIFontSize: TLabel;
145142
chkHorizontalScrollbar: TCheckBox;
146143
editQueryHistoryKeepDays: TEdit;
147144
updownQueryHistoryKeepDays: TUpDown;
@@ -369,7 +366,6 @@ procedure TfrmPreferences.Apply(Sender: TObject);
369366
AppSettings.WriteString(asGUIFontName, '')
370367
else
371368
AppSettings.WriteString(asGUIFontName, comboGUIFont.Text);
372-
AppSettings.WriteInt(asGUIFontSize, updownGUIFontSize.Position);
373369
AppSettings.WriteString(asTheme, comboTheme.Text);
374370
AppSettings.WriteString(asIconPack, comboIconPack.Text);
375371
AppSettings.WriteString(asWebSearchBaseUrl, comboWebSearchBaseUrl.Text);
@@ -730,7 +726,6 @@ procedure TfrmPreferences.FormShow(Sender: TObject);
730726
comboGUIFont.ItemIndex := 0
731727
else
732728
comboGUIFont.ItemIndex := comboGUIFont.Items.IndexOf(GUIFont);
733-
updownGUIFontSize.Position := AppSettings.ReadInt(asGUIFontSize);
734729
comboGUIFont.OnChange(comboGUIFont);
735730
comboTheme.ItemIndex := comboTheme.Items.IndexOf(AppSettings.ReadString(asTheme));
736731
comboIconPack.ItemIndex := comboIconPack.Items.IndexOf(AppSettings.ReadString(asIconPack));
@@ -1062,14 +1057,7 @@ procedure TfrmPreferences.comboGridTextColorsSelect(Sender: TObject);
10621057

10631058

10641059
procedure TfrmPreferences.comboGUIFontChange(Sender: TObject);
1065-
var
1066-
UseCustomFont: Boolean;
10671060
begin
1068-
// System font selected
1069-
UseCustomFont := comboGUIFont.ItemIndex > 0;
1070-
editGUIFontSize.Enabled := UseCustomFont;
1071-
updownGUIFontSize.Enabled := UseCustomFont;
1072-
lblGUIFontSize.Enabled := UseCustomFont;
10731061
Modified(Sender);
10741062
end;
10751063

0 commit comments

Comments
 (0)