mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 04:49:27 +02:00
Cocoa: Fix wrong window height and positioning
git-svn-id: trunk@43709 -
This commit is contained in:
parent
5f4cd1ad69
commit
1b626fc207
@ -1731,12 +1731,22 @@ end;
|
||||
|
||||
procedure LCLWindowExtension.lclSetFrame(const r: TRect);
|
||||
var
|
||||
ns: NSREct;
|
||||
ns: NSRect;
|
||||
nw,nf: NSRect;
|
||||
h:integer;
|
||||
begin
|
||||
if Assigned(screen) then
|
||||
LCLToNSRect(r, screen.frame.size.height, ns)
|
||||
else
|
||||
ns := RectToNSRect(r);
|
||||
|
||||
// get topbar height and add
|
||||
nf:= NSMakeRect (0, 0, 100, 100);
|
||||
nw:=contentRectForFrameRect(nf);
|
||||
h:=round(nf.size.height-nw.size.height);
|
||||
ns.size.height:=ns.size.height+h;
|
||||
ns.origin.y:=ns.origin.y-h;
|
||||
|
||||
setFrame_display(ns, isVisible);
|
||||
end;
|
||||
|
||||
|
@ -293,7 +293,7 @@ end;
|
||||
procedure LCLToNSRect(const lcl: TRect; ParentHeight: Single; out ns: NSRect);
|
||||
begin
|
||||
ns.origin.x:=lcl.left;
|
||||
ns.origin.y:=ParentHeight-(lcl.bottom-lcl.Top)-lcl.Top;
|
||||
ns.origin.y:=ParentHeight-lcl.bottom;
|
||||
ns.size.width:=lcl.Right-lcl.Left;
|
||||
ns.size.height:=lcl.Bottom-lcl.Top;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user