mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 10:59:19 +02:00
carbon: workaround for #12490. needs further investigation
git-svn-id: trunk@20763 -
This commit is contained in:
parent
df02752fd5
commit
1afac02c06
@ -173,6 +173,8 @@ type
|
||||
|
||||
procedure DestroyWidget; override;
|
||||
public
|
||||
function GetPreferredSize: TPoint; override;
|
||||
|
||||
procedure AddToWidget(AParent: TCarbonWidget); override;
|
||||
function GetMousePos: TPoint; override;
|
||||
function GetTopParentWindow: WindowRef; override;
|
||||
|
@ -1070,6 +1070,7 @@ function TCarbonControl.GetPreferredSize: TPoint;
|
||||
var
|
||||
R: MacOSAll.Rect;
|
||||
S: SmallInt;
|
||||
b: HIRect;
|
||||
begin
|
||||
Result.X := 0;
|
||||
Result.Y := 0;
|
||||
@ -1078,7 +1079,7 @@ begin
|
||||
|
||||
if OSError(GetBestControlRect(ControlRef(Widget), R, S), Self,
|
||||
'GetPreferredSize', 'GetBestControlRect') then Exit;
|
||||
|
||||
|
||||
Result.X := R.right - R.left;
|
||||
Result.Y := R.bottom - R.top;
|
||||
end;
|
||||
|
@ -1242,6 +1242,16 @@ begin
|
||||
//Widget := nil;
|
||||
end;
|
||||
|
||||
function TCarbonWindow.GetPreferredSize: TPoint;
|
||||
const
|
||||
MinWinSize = 20;
|
||||
begin
|
||||
//todo: find a proper way to determine prefered window size
|
||||
// by default Carbon returns a height too large
|
||||
Result.x:=MinWinSize;
|
||||
Result.y:=MinWinSize;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCarbonWindow.AddToWidget
|
||||
Params: AParent - Parent widget
|
||||
|
Loading…
Reference in New Issue
Block a user