Enclose [indicator setControlSize] in availability check

This commit is contained in:
ws909 2023-03-03 14:10:17 +01:00
parent 2244051453
commit 5301a924c4

View File

@ -202,10 +202,18 @@ static NSProgressIndicator* createProgressIndicator(const NSDockTile* dockTile)
NSView* contentView = [dockTile contentView]; NSView* contentView = [dockTile contentView];
NSProgressIndicator* indicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, contentView.frame.size.width, 15.0f)]; NSProgressIndicator* indicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, contentView.frame.size.width, 15.0f)];
[indicator setStyle:NSProgressIndicatorStyleBar]; [indicator setStyle:NSProgressIndicatorStyleBar];
[indicator setControlSize:NSControlSizeLarge];
if (@available(macOS 11.0, *))
{
[indicator setControlSize:NSControlSizeLarge];
}
[indicator setMinValue:0.0f]; [indicator setMinValue:0.0f];
[indicator setMaxValue:1.0f]; [indicator setMaxValue:1.0f];
[indicator sizeToFit];
[contentView addSubview:indicator]; [contentView addSubview:indicator];