mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Issue #1482: fix width and height of session manager being reset to design-time values through an internal Resize event. Now set dimensions in OnCreate rather than in OnShow without DPI awareness. Also, respect a non-96 value of a form's DesignTimePPI + PixelsPerInch in AppSettings.WriteIntDpiAware.
This commit is contained in:
@ -92,23 +92,8 @@ type
|
|||||||
|
|
||||||
// Download
|
// Download
|
||||||
THttpDownload = class(TFPHttpClient)
|
THttpDownload = class(TFPHttpClient)
|
||||||
//private
|
|
||||||
// FOwner: TComponent;
|
|
||||||
// FURL: String;
|
|
||||||
// FLastContent: String;
|
|
||||||
// FBytesRead: Integer;
|
|
||||||
// FContentLength: Integer;
|
|
||||||
// FTimeOut: Cardinal;
|
|
||||||
// FOnProgress: TNotifyEvent;
|
|
||||||
public
|
public
|
||||||
constructor Create(Owner: TComponent);
|
constructor Create(Owner: TComponent);
|
||||||
// procedure SendRequest(Filename: String);
|
|
||||||
// property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
|
|
||||||
// property URL: String read FURL write FURL;
|
|
||||||
// property TimeOut: Cardinal read FTimeOut write FTimeOut;
|
|
||||||
// property BytesRead: Integer read FBytesRead;
|
|
||||||
// property ContentLength: Integer read FContentLength;
|
|
||||||
// property LastContent: String read FLastContent;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Extended string list with support for empty values
|
// Extended string list with support for empty values
|
||||||
@ -4231,7 +4216,7 @@ function TAppSettings.ReadIntDpiAware(Index: TAppSettingIndex; AControl: TContro
|
|||||||
begin
|
begin
|
||||||
// take a forms DesignTimePPI into account
|
// take a forms DesignTimePPI into account
|
||||||
Result := ReadInt(Index, FormatName, Default);
|
Result := ReadInt(Index, FormatName, Default);
|
||||||
Result := AControl.Scale96ToForm(Result);
|
Result := AControl.ScaleDesignToForm(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -4317,7 +4302,7 @@ end;
|
|||||||
|
|
||||||
procedure TAppSettings.WriteIntDpiAware(Index: TAppSettingIndex; AControl: TControl; Value: Integer; FormatName: String='');
|
procedure TAppSettings.WriteIntDpiAware(Index: TAppSettingIndex; AControl: TControl; Value: Integer; FormatName: String='');
|
||||||
begin
|
begin
|
||||||
Value := AControl.ScaleFormTo96(Value);
|
Value := AControl.ScaleFormToDesign(Value);
|
||||||
WriteInt(Index, Value, FormatName);
|
WriteInt(Index, Value, FormatName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||||
laz.VirtualTrees, Menus, Graphics, Generics.Collections, extra_controls,
|
laz.VirtualTrees, Menus, Graphics, Generics.Collections, extra_controls,
|
||||||
dbconnection, RegExpr, Types, GraphUtil, StrUtils,
|
dbconnection, RegExpr, Types, GraphUtil, StrUtils, FileUtil,
|
||||||
Math, ActnList, StdActns, comboex, EditBtn, Buttons, colorbox;
|
Math, ActnList, StdActns, comboex, EditBtn, Buttons, colorbox;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -284,8 +284,20 @@ var
|
|||||||
ComboItem: TComboExItem;
|
ComboItem: TComboExItem;
|
||||||
Placeholders: TStringList;
|
Placeholders: TStringList;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
ExeFiles: TStringDynArray;
|
ExeFiles: TStringList;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
Width := AppSettings.ReadInt(asSessionManagerWindowWidth);
|
||||||
|
Height := AppSettings.ReadInt(asSessionManagerWindowHeight);
|
||||||
|
Left := AppSettings.ReadInt(asSessionManagerWindowLeft, '', Left);
|
||||||
|
Top := AppSettings.ReadInt(asSessionManagerWindowTop, '', Top);
|
||||||
|
// Move to visible area if window was on a now plugged off monitor previously
|
||||||
|
MakeFullyVisible;
|
||||||
|
pnlLeft.Width := AppSettings.ReadInt(asSessionManagerListWidth);
|
||||||
|
splitterMain.OnMoved(Sender);
|
||||||
|
FixVT(ListSessions);
|
||||||
|
RestoreListSetup(ListSessions);
|
||||||
|
|
||||||
// Fix GUI stuff
|
// Fix GUI stuff
|
||||||
HasSizeGrip := True;
|
HasSizeGrip := True;
|
||||||
Caption := GetWindowCaption;
|
Caption := GetWindowCaption;
|
||||||
@ -322,14 +334,14 @@ begin
|
|||||||
editLogFilePath.Hint := FilenameHint;
|
editLogFilePath.Hint := FilenameHint;
|
||||||
|
|
||||||
// Populate dropdown with supported SSH executables
|
// Populate dropdown with supported SSH executables
|
||||||
{ExeFiles := TDirectory.GetFiles(ExtractFilePath(ParamStr(0)), '*.exe');
|
ExeFiles := FindAllFiles(ExtractFilePath(ParamStr(0)), '*.exe', False);
|
||||||
for ExePath in ExeFiles do begin
|
for ExePath in ExeFiles do begin
|
||||||
ExeFile := ExtractFileName(ExePath);
|
ExeFile := ExtractFileName(ExePath);
|
||||||
if ExecRegExprI('([pk]link|putty)', ExeFile) then begin
|
if ExecRegExprI('([pk]link|putty)', ExeFile) then begin
|
||||||
comboSSHExe.Items.Add(ExeFile);
|
comboSSHExe.Items.Add(ExeFile);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
SetLength(ExeFiles, 0);}
|
ExeFiles.Free;
|
||||||
comboSSHExe.Items.Add('ssh.exe');
|
comboSSHExe.Items.Add('ssh.exe');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -400,17 +412,6 @@ var
|
|||||||
PSess: PConnectionParameters;
|
PSess: PConnectionParameters;
|
||||||
Node: PVirtualNode;
|
Node: PVirtualNode;
|
||||||
begin
|
begin
|
||||||
Width := AppSettings.ReadIntDpiAware(asSessionManagerWindowWidth, Self);
|
|
||||||
Height := AppSettings.ReadIntDpiAware(asSessionManagerWindowHeight, Self);
|
|
||||||
Left := AppSettings.ReadInt(asSessionManagerWindowLeft, '', Left);
|
|
||||||
Top := AppSettings.ReadInt(asSessionManagerWindowTop, '', Top);
|
|
||||||
// Move to visible area if window was on a now plugged off monitor previously
|
|
||||||
MakeFullyVisible;
|
|
||||||
pnlLeft.Width := AppSettings.ReadIntDpiAware(asSessionManagerListWidth, Self);
|
|
||||||
splitterMain.OnMoved(Sender);
|
|
||||||
FixVT(ListSessions);
|
|
||||||
RestoreListSetup(ListSessions);
|
|
||||||
|
|
||||||
// Init sessions tree
|
// Init sessions tree
|
||||||
RefreshSessions(nil);
|
RefreshSessions(nil);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user