cocoa: using only fixed width for filters in Big Sur and later. This prevents contant resizing of the dialog. bug #38121

git-svn-id: trunk@64175 -
This commit is contained in:
dmitry 2020-12-07 00:00:36 +00:00
parent 4e0d02024d
commit aa83422093
2 changed files with 7 additions and 1 deletions

View File

@ -248,6 +248,7 @@ const
NSAppKitVersionNumber10_13 = 1561;
//NSAppKitVersionNumber10_14 = 1641.10; // Mojave's beta?
NSAppKitVersionNumber10_14 = 1671;
NSAppKitVersionNumber11_0 = 2022; // 2000 starts with beta?

View File

@ -291,7 +291,12 @@ var
lDialogView := NSView(ASaveOwner.contentView);
if lDialogView <> nil then
begin
if lDialogView.frame.size.width > INT_MIN_ACCESSORYVIEW_WIDTH then
if (NSAppkitVersionNumber >= NSAppKitVersionNumber11_0) then
// starting with Big Sur, the dialog retains the last openned size
// causing the width to be increased on every openning of the dialog
// we'd simply force the lAccessoryWidth to start with the minimum width
lAccessoryWidth := INT_MIN_ACCESSORYVIEW_WIDTH
else if lDialogView.frame.size.width > INT_MIN_ACCESSORYVIEW_WIDTH then
lAccessoryWidth := Round(lDialogView.frame.size.width);
end;
lRect := GetNSRect(0, 0, lAccessoryWidth, 30);