mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 16:49:44 +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
@ -33,6 +33,7 @@ var
|
|||||||
Prompt: TLabel;
|
Prompt: TLabel;
|
||||||
Edit: TEdit;
|
Edit: TEdit;
|
||||||
MinEditWidth: integer;
|
MinEditWidth: integer;
|
||||||
|
AMonitor: TMonitor;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
Form := TForm.CreateNew(nil, 0);
|
Form := TForm.CreateNew(nil, 0);
|
||||||
@ -55,7 +56,10 @@ begin
|
|||||||
Parent := Form;
|
Parent := Form;
|
||||||
Align := alTop;
|
Align := alTop;
|
||||||
BorderSpacing.Top := 3;
|
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;
|
Constraints.MinWidth := MinEditWidth;
|
||||||
Text := Value;
|
Text := Value;
|
||||||
TabStop := True;
|
TabStop := True;
|
||||||
|
Loading…
Reference in New Issue
Block a user