From 5301a924c42e6e0a1a18020282e2fdf9d45741ea Mon Sep 17 00:00:00 2001 From: ws909 <37029098+ws909@users.noreply.github.com> Date: Fri, 3 Mar 2023 14:10:17 +0100 Subject: [PATCH] Enclose [indicator setControlSize] in availability check --- src/cocoa_window.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index ff2e8f9a..7ec251e0 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -202,10 +202,18 @@ static NSProgressIndicator* createProgressIndicator(const NSDockTile* dockTile) NSView* contentView = [dockTile contentView]; NSProgressIndicator* indicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, contentView.frame.size.width, 15.0f)]; + [indicator setStyle:NSProgressIndicatorStyleBar]; - [indicator setControlSize:NSControlSizeLarge]; + + if (@available(macOS 11.0, *)) + { + [indicator setControlSize:NSControlSizeLarge]; + } + [indicator setMinValue:0.0f]; [indicator setMaxValue:1.0f]; + + [indicator sizeToFit]; [contentView addSubview:indicator];