fix 'setNeedsDisplay' is deprecated: first deprecated in macOS 10.14 (#5633)

This commit is contained in:
Cœur 2023-06-18 20:32:34 +02:00 committed by Charles Kerr
parent bc9e8e406e
commit 90f8db7bf7
2 changed files with 9 additions and 3 deletions

View File

@ -129,7 +129,7 @@ typedef struct PieceInfo
self.image = [[NSImage alloc] initWithSize:self.bounds.size];
[self clearView];
[self setNeedsDisplay];
self.needsDisplay = YES;
}
- (void)clearView
@ -196,7 +196,7 @@ typedef struct PieceInfo
NSRectFillListWithColors(cFillRects, cFillColors, numCells);
return YES;
}];
[self setNeedsDisplay];
self.needsDisplay = YES;
}
// save the current state so we can compare it later

View File

@ -126,7 +126,13 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175;
//disable highlight color and set manually in drawRow
[self setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleNone];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(setNeedsDisplay) name:@"RefreshTorrentTable" object:nil];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(refreshTorrentTable) name:@"RefreshTorrentTable"
object:nil];
}
- (void)refreshTorrentTable
{
self.needsDisplay = YES;
}
- (BOOL)isGroupCollapsed:(NSInteger)value