mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 18:58:04 +02:00
Merged revision(s) 57361 #b4037cfd4f from trunk:
SynEdit: Completion box, respect space for taskbar. Use screen.WorkArea. Issue #033180 ........ git-svn-id: branches/fixes_1_8@57366 -
This commit is contained in:
parent
d107d9965e
commit
68cdda4d8b
@ -1437,13 +1437,19 @@ procedure TSynBaseCompletion.Execute(s: string; TokenRect: TRect);
|
||||
var
|
||||
SpaceBelow, SpaceAbove: Integer;
|
||||
Mon: TMonitor;
|
||||
MRect: TRect;
|
||||
begin
|
||||
Mon := Screen.MonitorFromPoint(TokenRect.TopLeft);
|
||||
if Mon <> nil then
|
||||
TokenRect.Left := Min(TokenRect.Left, Mon.Left + Mon.Width - Form.Width);
|
||||
if Mon = nil then begin
|
||||
Execute(s, TokenRect.Left, TokenRect.Bottom);
|
||||
exit;
|
||||
end;
|
||||
|
||||
SpaceBelow := Mon.Height - TokenRect.Bottom;
|
||||
SpaceAbove := TokenRect.Top - Mon.Top;
|
||||
MRect := Mon.WorkareaRect; // BoundsRect on Windows, if overlap with Taskbar is desired
|
||||
TokenRect.Left := Max(MRect.Left, Min(TokenRect.Left, MRect.Right - Form.Width));
|
||||
|
||||
SpaceBelow := MRect.Bottom - TokenRect.Bottom;
|
||||
SpaceAbove := TokenRect.Top - MRect.Top;
|
||||
if Form.Height < SpaceBelow then
|
||||
Execute(s, TokenRect.Left, TokenRect.Bottom)
|
||||
else
|
||||
@ -1457,7 +1463,7 @@ begin
|
||||
end else begin
|
||||
Form.NbLinesInWindow := Max(SpaceAbove div Form.FontHeight, 3); // temporary height
|
||||
Execute(s, TokenRect.Left, TokenRect.Top - Form.Height);
|
||||
end;;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user