Permalink
Browse files

Restore multi line grid setup, broken in recent commit

  • Loading branch information...
ansgarbecker committed Dec 18, 2018
1 parent f2babc8 commit fe9c92aee30f7858132d412109f9b05329e69c18
Showing with 30 additions and 27 deletions.
  1. +30 −27 source/apphelpers.pas
@@ -1459,12 +1459,15 @@ procedure StreamToClipboard(Text, HTML: TStream; CreateHTMLHeader: Boolean);

procedure FixVT(VT: TVirtualStringTree; MultiLineCount: Word=1);
var
SingleLineHeight: Integer;
Node: PVirtualNode;
begin
// This is called either in some early stage, or from preferences dialog
VT.BeginUpdate;
SingleLineHeight := GetTextHeight(VT.Font) + 3;
// Multiline nodes?
if MultiLineCount > 1 then
VT.DefaultNodeHeight := VT.DefaultNodeHeight * MultiLineCount + 5;
VT.DefaultNodeHeight := SingleLineHeight * MultiLineCount;
VT.Header.Height := SingleLineHeight;
// Apply new height to multi line grid nodes
Node := VT.GetFirstInitialized;
while Assigned(Node) do begin
@@ -1774,36 +1777,36 @@ procedure ExplodeQuotedList(Text: String; var List: TStringList);

procedure InheritFont(AFont: TFont);
var
LogFont: TLogFont;
GUIFontName: String;
begin
// Set custom font if set, or default system font.
// In high-dpi mode, the font *size* is increased automatically somewhere in the VCL,
// caused by a form's .Scaled property. So we don't increase it here again.
// To test this, you really need to log off/on Windows!
GUIFontName := AppSettings.ReadString(asGUIFontName);
if not GUIFontName.IsEmpty then begin
LogFont: TLogFont;
GUIFontName: String;
begin
// Set custom font if set, or default system font.
// In high-dpi mode, the font *size* is increased automatically somewhere in the VCL,
// caused by a form's .Scaled property. So we don't increase it here again.
// To test this, you really need to log off/on Windows!
GUIFontName := AppSettings.ReadString(asGUIFontName);
if not GUIFontName.IsEmpty then begin
// Apply user specified font
AFont.Name := GUIFontName;
// Set size on top of automatic dpi-increased size
AFont.Size := AppSettings.ReadInt(asGUIFontSize);
end else begin
// Apply system font. See issue #3204.
// Code taken from http://www.gerixsoft.com/blog/delphi/system-font
if SystemParametersInfo(SPI_GETICONTITLELOGFONT, SizeOf(TLogFont), @LogFont, 0) then begin
AFont.Height := LogFont.lfHeight;
AFont.Orientation := LogFont.lfOrientation;
AFont.Charset := TFontCharset(LogFont.lfCharSet);
AFont.Name := PChar(@LogFont.lfFaceName);
case LogFont.lfPitchAndFamily and $F of
VARIABLE_PITCH: AFont.Pitch := fpVariable;
FIXED_PITCH: AFont.Pitch := fpFixed;
else AFont.Pitch := fpDefault;
end;
end;
end;
end;

// Apply system font. See issue #3204.
// Code taken from http://www.gerixsoft.com/blog/delphi/system-font
if SystemParametersInfo(SPI_GETICONTITLELOGFONT, SizeOf(TLogFont), @LogFont, 0) then begin
AFont.Height := LogFont.lfHeight;
AFont.Orientation := LogFont.lfOrientation;
AFont.Charset := TFontCharset(LogFont.lfCharSet);
AFont.Name := PChar(@LogFont.lfFaceName);
case LogFont.lfPitchAndFamily and $F of
VARIABLE_PITCH: AFont.Pitch := fpVariable;
FIXED_PITCH: AFont.Pitch := fpFixed;
else AFont.Pitch := fpDefault;
end;
end;
end;
end;


function GetLightness(AColor: TColor): Byte;
var

0 comments on commit fe9c92a

Please sign in to comment.