mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 11:40:35 +02:00
cocoa: update TCocoaDatePicker to work on macOS 10.6
git-svn-id: trunk@61191 -
This commit is contained in:
parent
868bbcd076
commit
48ed31da02
@ -84,13 +84,22 @@ begin
|
||||
inherited setFrame(aframe);
|
||||
if not autoResize then Exit;
|
||||
|
||||
fsz:=fittingSize;
|
||||
if Self.respondsToSelector(objcselector('fittingSize')) then
|
||||
fsz:=fittingSize
|
||||
else
|
||||
begin
|
||||
// hardcoded size of a Calendar for MacOSX 10.6
|
||||
// as can be seen in Interface Builder
|
||||
fsz.width := 139;
|
||||
fsz.height := 148;
|
||||
end;
|
||||
|
||||
if (fsz.width=0) or (fsz.height=0) then Exit;
|
||||
sz:=frame.size;
|
||||
//don't resize if too small already
|
||||
if (sz.width<fsz.width) or (sz.height<fsz.height) then Exit;
|
||||
|
||||
if retainAspectRatio and (fsz.height>0) and (sz.height<>0) then
|
||||
if retainAspectRatio and (fsz.height>0) then
|
||||
begin
|
||||
rt:=fsz.width/fsz.height;
|
||||
fsz.width:=fsz.width * sz.width / (sz.height*rt);
|
||||
|
Loading…
Reference in New Issue
Block a user