Skip to content
Permalink
Browse files

High DPI: Scale up font size when applying font to query editors and …

…result grids

Todo: mouse wheel zooming seems broken on dpi > 100%
  • Loading branch information...
ansgarbecker committed Jul 17, 2019
1 parent 92c8f62 commit 70c79b33c5c71e2ff70380324e516567ecf6d53c
Showing with 5 additions and 5 deletions.
  1. +5 −5 source/main.pas
@@ -1922,8 +1922,8 @@ procedure TMainForm.FormCreate(Sender: TObject);
// Data-Font:
DataGrid.Font.Name := AppSettings.ReadString(asDataFontName);
QueryGrid.Font.Name := AppSettings.ReadString(asDataFontName);
DataGrid.Font.Size := AppSettings.ReadInt(asDataFontSize);
QueryGrid.Font.Size := AppSettings.ReadInt(asDataFontSize);
DataGrid.Font.Size := Round(AppSettings.ReadInt(asDataFontSize) * DpiScaleFactor(Self));
QueryGrid.Font.Size := Round(AppSettings.ReadInt(asDataFontSize) * DpiScaleFactor(Self));
FixVT(DataGrid, AppSettings.ReadInt(asGridRowLineCount));
FixVT(QueryGrid, AppSettings.ReadInt(asGridRowLineCount));
// Load color settings
@@ -8012,14 +8012,14 @@ procedure TMainForm.ApplyFontToGrids;
begin
// Apply somehow changed font settings to all existing grids
DataGrid.Font.Name := AppSettings.ReadString(asDataFontName);
DataGrid.Font.Size := AppSettings.ReadInt(asDataFontSize);
DataGrid.Font.Size := Round(AppSettings.ReadInt(asDataFontSize) * DpiScaleFactor(Self));
FixVT(Mainform.DataGrid, AppSettings.ReadInt(asGridRowLineCount));
for i:=Mainform.tabQuery.PageIndex to Mainform.PageControlMain.PageCount-1 do begin
QueryTab := Mainform.QueryTabs[i-Mainform.tabQuery.PageIndex];
for j:=0 to QueryTab.ResultTabs.Count-1 do begin
Grid := QueryTab.ResultTabs[j].Grid;
Grid.Font.Name := AppSettings.ReadString(asDataFontName);
Grid.Font.Size := AppSettings.ReadInt(asDataFontSize);
Grid.Font.Size := Round(AppSettings.ReadInt(asDataFontSize) * DpiScaleFactor(Self));
FixVT(Grid, AppSettings.ReadInt(asGridRowLineCount));
end;
end;
@@ -11521,7 +11521,7 @@ procedure TMainform.SetupSynEditors;
Editor.Color := GetThemeColor(clWindow);
Editor.ScrollHintColor := GetThemeColor(clInfoBk);
Editor.Font.Name := AppSettings.ReadString(asFontName);
Editor.Font.Size := AppSettings.ReadInt(asFontSize);
Editor.Font.Size := Round(AppSettings.ReadInt(asFontSize) * DpiScaleFactor(Self));
Editor.Gutter.BorderColor := GetThemeColor(clWindow);
Editor.Gutter.Color := GetThemeColor(clBtnFace);
Editor.Gutter.Font.Name := Editor.Font.Name;

0 comments on commit 70c79b3

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