Cocoa: Fix wrong window height and positioning

git-svn-id: trunk@43709 -
This commit is contained in:
freq 2014-01-11 19:42:16 +00:00
parent 5f4cd1ad69
commit 1b626fc207
2 changed files with 12 additions and 2 deletions

View File

@ -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;

View File

@ -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;