Remove SetVistaFont(), move code to the only caller of it in TMainForm.FormCreate.

This commit is contained in:
Ansgar Becker
2011-05-27 05:10:40 +00:00
parent c4565ec764
commit ad9aba3549
2 changed files with 6 additions and 17 deletions

View File

@ -197,7 +197,6 @@ type
function MessageDialog(const Title, Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): Integer; overload;
function ErrorDialog(Msg: string): Integer; overload;
function ErrorDialog(const Title, Msg: string): Integer; overload;
procedure SetVistaFonts(const AFont: TFont);
var
MainReg: TRegistry;
@ -2653,20 +2652,6 @@ begin
end;
procedure SetVistaFonts(const AFont: TFont);
const
VistaFont = 'Segoe UI';
begin
if (Win32MajorVersion >= 6)
and not SameText(AFont.Name, VistaFont)
and (Screen.Fonts.IndexOf(VistaFont) >= 0) then
begin
AFont.Size := AFont.Size + 1;
AFont.Name := VistaFont;
end;
end;
{ Threading stuff }

View File

@ -1275,6 +1275,8 @@ end;
to complete and can be annoying.
}
procedure TMainForm.FormCreate(Sender: TObject);
const
VistaFont = 'Segoe UI';
var
i, j, MonitorIndex: Integer;
datafontname: String;
@ -1384,8 +1386,10 @@ begin
Delimiter := GetRegValue(REGNAME_DELIMITER, DEFAULT_DELIMITER);
// Delphi work around to force usage of Vista's default font (other OSes will be unaffected)
SetVistaFonts(Font);
InheritFont(Font);
if (Win32MajorVersion >= 6) and (Screen.Fonts.IndexOf(VistaFont) >= 0) then begin
Font.Size := Font.Size + 1;
Font.Name := VistaFont;
end;
InheritFont(SynCompletionProposal.Font);
InheritFont(ParameterCompletionProposal.Font);
// Simulated link label, has non inherited blue font color