mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 14:38:01 +02:00
lcl: don't create InputBox bigger than monitor in width (issue #0013740)
git-svn-id: trunk@20025 -
This commit is contained in:
parent
447f5d8a3c
commit
ec8b2fae86
@ -29,10 +29,11 @@ function ShowInputDialog(const InputCaption, InputPrompt : String;
|
||||
end;
|
||||
|
||||
var
|
||||
Form : TForm;
|
||||
Prompt : TLabel;
|
||||
Edit : TEdit;
|
||||
Form: TForm;
|
||||
Prompt: TLabel;
|
||||
Edit: TEdit;
|
||||
MinEditWidth: integer;
|
||||
AMonitor: TMonitor;
|
||||
begin
|
||||
Result := False;
|
||||
Form := TForm.CreateNew(nil, 0);
|
||||
@ -55,7 +56,10 @@ begin
|
||||
Parent := Form;
|
||||
Align := alTop;
|
||||
BorderSpacing.Top := 3;
|
||||
MinEditWidth := max(260, ActiveMonitor.Width div 4);
|
||||
AMonitor := ActiveMonitor;
|
||||
// check that edit is smaller than our monitor, it must be smaller at least
|
||||
// by 6 * 2 pixels (spacing from window borders) + window border
|
||||
MinEditWidth := Min(AMonitor.Width - 20, Max(260, AMonitor.Width div 4));
|
||||
Constraints.MinWidth := MinEditWidth;
|
||||
Text := Value;
|
||||
TabStop := True;
|
||||
|
Loading…
Reference in New Issue
Block a user