Skip to content
Permalink
Browse files

Issue #213: Assign system or custom font once, to the application, an…

…d let all forms inherit that font, so there is no need to call InheritFont() for each form.
  • Loading branch information...
ansgarbecker committed Oct 25, 2018
1 parent 0d7e459 commit 9cdcd631454f6f9e999893ea89fcf502d994474c
Showing with 34 additions and 189 deletions.
  1. +1 −0 packages/Delphi10.2/heidisql.dpr
  2. +1 −5 source/about.dfm
  3. +0 −1 source/about.pas
  4. +1 −5 source/bineditor.dfm
  5. +0 −1 source/bineditor.pas
  6. +1 −5 source/change_password.dfm
  7. +0 −1 source/change_password.pas
  8. +1 −5 source/column_selection.dfm
  9. +0 −1 source/column_selection.pas
  10. +1 −5 source/connections.dfm
  11. +0 −1 source/connections.pas
  12. +2 −10 source/copytable.dfm
  13. +0 −1 source/copytable.pas
  14. +1 −5 source/createdatabase.dfm
  15. +0 −1 source/createdatabase.pas
  16. +1 −5 source/data_sorting.dfm
  17. +0 −1 source/data_sorting.pas
  18. +1 −5 source/editvar.dfm
  19. +0 −1 source/editvar.pas
  20. +1 −5 source/exportgrid.dfm
  21. +0 −1 source/exportgrid.pas
  22. +1 −5 source/insertfiles.dfm
  23. +0 −1 source/insertfiles.pas
  24. +1 −5 source/loaddata.dfm
  25. +0 −1 source/loaddata.pas
  26. +1 −5 source/loginform.dfm
  27. +0 −1 source/loginform.pas
  28. +3 −15 source/main.dfm
  29. +0 −1 source/main.pas
  30. +2 −10 source/options.dfm
  31. +0 −1 source/options.pas
  32. +1 −5 source/printlist.dfm
  33. +0 −1 source/printlist.pas
  34. +1 −5 source/searchreplace.dfm
  35. +0 −1 source/searchreplace.pas
  36. +2 −10 source/selectdbobject.dfm
  37. +0 −1 source/selectdbobject.pas
  38. +2 −10 source/sqlhelp.dfm
  39. +0 −1 source/sqlhelp.pas
  40. +3 −15 source/syncdb.dfm
  41. +0 −1 source/syncdb.pas
  42. +2 −10 source/tabletools.dfm
  43. +0 −1 source/tabletools.pas
  44. +1 −5 source/texteditor.dfm
  45. +0 −1 source/texteditor.pas
  46. +1 −5 source/updatecheck.dfm
  47. +0 −1 source/updatecheck.pas
  48. +1 −5 source/usermanager.dfm
  49. +0 −1 source/usermanager.pas
@@ -73,6 +73,7 @@ begin
Application.Initialize;
Application.Title := APPNAME;
Application.UpdateFormatSettings := False;
AppHelpers.InheritFont(Application.DefaultFont);
Application.CreateForm(TMainForm, MainForm);
MainForm.AfterFormCreate;
Application.OnDeactivate := MainForm.ApplicationDeActivate;
@@ -6,11 +6,7 @@ object AboutBox: TAboutBox
ClientHeight = 315
ClientWidth = 481
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
FormStyle = fsStayOnTop
OldCreateOrder = True
Position = poOwnerFormCenter
@@ -124,7 +124,6 @@ procedure TAboutBox.editDonatedExit(Sender: TObject);
procedure TAboutBox.FormCreate(Sender: TObject);
begin
TranslateComponent(Self);
InheritFont(Font);
lblAppName.Font.Size := Round(lblAppName.Font.Size * 1.5);
lblAppName.Font.Style := [fsBold];
lblAppWebpage.Font.Color := clBlue;
@@ -7,11 +7,7 @@ object frmBinEditor: TfrmBinEditor
Color = clBtnFace
Constraints.MinHeight = 100
Constraints.MinWidth = 130
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poMainFormCenter
OnClose = FormClose
@@ -79,7 +79,6 @@ procedure TfrmBinEditor.SetFont(font: TFont);

procedure TfrmBinEditor.FormCreate(Sender: TObject);
begin
InheritFont(Font);
TranslateComponent(Self);
end;

@@ -10,11 +10,7 @@ object frmPasswordChange: TfrmPasswordChange
Constraints.MaxWidth = 600
Constraints.MinHeight = 185
Constraints.MinWidth = 400
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
@@ -58,7 +58,6 @@ implementation
procedure TfrmPasswordChange.FormCreate(Sender: TObject);
begin
TranslateComponent(Self);
InheritFont(Font);
end;


@@ -8,11 +8,7 @@ object ColumnSelectionForm: TColumnSelectionForm
Color = clBtnFace
Constraints.MinHeight = 150
Constraints.MinWidth = 200
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
@@ -45,7 +45,6 @@ implementation

procedure TColumnSelectionForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
TranslateComponent(Self);
Width := AppSettings.ReadInt(asColumnSelectorWidth);
Height := AppSettings.ReadInt(asColumnSelectorHeight);
@@ -8,11 +8,7 @@ object connform: Tconnform
Color = clBtnFace
Constraints.MinHeight = 400
Constraints.MinWidth = 665
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
ShowHint = True
OnClose = FormClose
@@ -223,7 +223,6 @@ procedure Tconnform.FormCreate(Sender: TObject);
begin
// Fix GUI stuff
TranslateComponent(Self);
InheritFont(Font);
FixDropDownButtons(Self);
lblDownloadPlink.Font.Style := [fsUnderline];
lblDownloadPlink.Font.Color := clBlue;
@@ -7,11 +7,7 @@ object CopyTableForm: TCopyTableForm
Color = clBtnFace
Constraints.MinHeight = 340
Constraints.MinWidth = 380
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poMainFormCenter
OnClose = FormClose
@@ -92,12 +88,8 @@ object CopyTableForm: TCopyTableForm
Height = 88
Anchors = [akLeft, akTop, akRight, akBottom]
Header.AutoSizeIndex = 0
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.MainColumn = -1
Header.ParentFont = True
Images = MainForm.ImageListMain
TabOrder = 2
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScroll, toAutoScrollOnExpand, toAutoTristateTracking, toAutoDeleteMovedNodes]
@@ -69,7 +69,6 @@ procedure TCopyTableForm.FormCreate(Sender: TObject);
begin
TranslateComponent(Self);
FixDropDownButtons(Self);
InheritFont(Font);
Width := AppSettings.ReadInt(asCopyTableWindowWidth);
Height := AppSettings.ReadInt(asCopyTableWindowHeight);
MainForm.SetupSynEditors;
@@ -6,11 +6,7 @@ object CreateDatabaseForm: TCreateDatabaseForm
ClientHeight = 227
ClientWidth = 317
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poOwnerFormCenter
OnClose = FormClose
@@ -41,7 +41,6 @@ implementation

procedure TCreateDatabaseForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
TranslateComponent(Self);
lblCreateCode.Caption := lblCreateCode.Caption + ':';
// Setup SynMemoPreview
@@ -6,11 +6,7 @@ object DataSortingForm: TDataSortingForm
ClientHeight = 97
ClientWidth = 204
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
@@ -53,7 +53,6 @@ implementation

procedure TDataSortingForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
TranslateComponent(Self);
ColumnNames := TStringList.Create;
end;
@@ -7,11 +7,7 @@ object frmEditVariable: TfrmEditVariable
Color = clBtnFace
Constraints.MinHeight = 260
Constraints.MinWidth = 200
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
@@ -55,7 +55,6 @@ implementation

procedure TfrmEditVariable.FormCreate(Sender: TObject);
begin
InheritFont(Font);
TranslateComponent(Self);
Width := AppSettings.ReadInt(asEditVarWindowWidth);
Height := AppSettings.ReadInt(asEditVarWindowHeight);
@@ -6,11 +6,7 @@ object frmExportGrid: TfrmExportGrid
ClientHeight = 432
ClientWidth = 383
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poMainFormCenter
OnClose = FormClose
@@ -102,7 +102,6 @@ procedure TfrmExportGrid.FormCreate(Sender: TObject);
FormatDesc: String;
begin
TranslateComponent(Self);
InheritFont(Font);
editFilename.Text := AppSettings.ReadString(asGridExportFilename);
radioOutputCopyToClipboard.Checked := AppSettings.ReadBool(asGridExportOutputCopy);
radioOutputFile.Checked := AppSettings.ReadBool(asGridExportOutputFile);
@@ -8,11 +8,7 @@ object frmInsertFiles: TfrmInsertFiles
Color = clBtnFace
Constraints.MinHeight = 353
Constraints.MinWidth = 475
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poOwnerFormCenter
OnClose = FormClose
@@ -119,7 +119,6 @@ procedure TfrmInsertFiles.FormCreate(Sender: TObject);
TranslateComponent(Self);
ListFiles.Images := GetSystemImageList;
DragAcceptFiles(Handle, True);
InheritFont(Font);
MainForm.RestoreListSetup(ListColumns);
MainForm.RestoreListSetup(ListFiles);
FixVT(ListFiles);
@@ -7,11 +7,7 @@ object loaddataform: Tloaddataform
Color = clBtnFace
Constraints.MinHeight = 530
Constraints.MinWidth = 525
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poMainFormCenter
OnClose = FormClose
@@ -96,7 +96,6 @@ implementation
procedure Tloaddataform.FormCreate(Sender: TObject);
begin
TranslateComponent(Self);
InheritFont(Font);
// Restore settings
Width := AppSettings.ReadInt(asCSVImportWindowWidth);
Height := AppSettings.ReadInt(asCSVImportWindowHeight);
@@ -6,11 +6,7 @@ object frmLogin: TfrmLogin
ClientHeight = 176
ClientWidth = 270
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
@@ -37,7 +37,6 @@ implementation
procedure TfrmLogin.FormCreate(Sender: TObject);
begin
TranslateComponent(Self);
InheritFont(Font);
Caption := APPNAME + ' - Login';
MainForm.ImageListMain.GetBitmap(144, imgIcon.Picture.Bitmap);
lblPrompt.Font.Size := 10;
@@ -4,11 +4,7 @@ object MainForm: TMainForm
ClientHeight = 486
ClientWidth = 824
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Default'
Font.Style = []
ParentFont = True
OldCreateOrder = True
Position = poDesigned
ShowHint = True
@@ -155,12 +151,8 @@ object MainForm: TMainForm
DragMode = dmAutomatic
DragType = dtVCL
Header.AutoSizeIndex = 0
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Options = [hoAutoResize, hoColumnResize, hoDrag]
Header.ParentFont = True
HintMode = hmTooltip
HotCursor = crHandPoint
Images = ImageListMain
@@ -1372,12 +1364,8 @@ object MainForm: TMainForm
DragMode = dmAutomatic
DragType = dtVCL
Header.AutoSizeIndex = 0
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoShowSortGlyphs]
Header.ParentFont = True
Images = ImageListMain
IncrementalSearch = isAll
PopupMenu = popupQueryHelpers
@@ -1745,7 +1745,6 @@ procedure TMainForm.FormCreate(Sender: TObject);

Delimiter := AppSettings.ReadString(asDelimiter);

InheritFont(Font);
InheritFont(SynCompletionProposal.Font);
// Simulated link label, has non inherited blue font color
lblExplainProcess.Font.Color := clBlue;
@@ -6,11 +6,7 @@ object optionsform: Toptionsform
ClientHeight = 424
ClientWidth = 732
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
@@ -1124,12 +1120,8 @@ object optionsform: Toptionsform
Height = 349
Align = alLeft
Header.AutoSizeIndex = 0
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.MainColumn = -1
Header.ParentFont = True
Images = MainForm.ImageListMain
TabOrder = 0
OnFocusChanged = TreeShortcutItemsFocusChanged
@@ -410,7 +410,6 @@ procedure Toptionsform.FormCreate(Sender: TObject);
dtc: TDBDatatypeCategoryIndex;
begin
TranslateComponent(Self);
InheritFont(Font);

// Misecllaneous
// Hide browse button on Wine, as the browse dialog returns Windows-style paths, while we need a Unix path
@@ -6,11 +6,7 @@ object printlistForm: TprintlistForm
ClientHeight = 92
ClientWidth = 377
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = True
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
@@ -41,7 +41,6 @@ implementation

procedure TprintlistForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
TranslateComponent(Self);
end;

0 comments on commit 9cdcd63

Please sign in to comment.
You can’t perform that action at this time.