mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 12:39:18 +02:00
cocoa: restore the frame size after calling sizetoFit in fittingSize. Prevents SpinEdit from resizing. #33616
git-svn-id: trunk@57734 -
This commit is contained in:
parent
4eac309f55
commit
f84ad3c0b2
@ -5515,12 +5515,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TCocoaSpinEdit.fittingSize: NSSize;
|
function TCocoaSpinEdit.fittingSize: NSSize;
|
||||||
|
var
|
||||||
|
fr : NSRect;
|
||||||
begin
|
begin
|
||||||
Result.width := -1;
|
Result.width := -1;
|
||||||
|
fr:=frame;
|
||||||
sizeToFit();
|
sizeToFit();
|
||||||
Result.height := bounds.size.height;
|
Result.height := bounds.size.height;
|
||||||
|
if not NSEqualRects(frame, fr) then setFrame(fr); // prevent changes of frame after sizeToFit();
|
||||||
{$IFDEF COCOA_SPIN_DEBUG}
|
{$IFDEF COCOA_SPIN_DEBUG}
|
||||||
WriteLn('[TCocoaSpinEdit.fittingSize] width=', Result.width, ' height=', Result.height);
|
WriteLn('[TCocoaSpinEdit.fittingSize] width=', Result.width:0:0, ' height=', Result.height:0:0);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user