Use property instead of method

This commit is contained in:
Michael Starke
2020-07-14 11:14:22 +02:00
parent f626266fa7
commit 18c7930dba
2 changed files with 5 additions and 2 deletions

View File

@@ -31,7 +31,6 @@ typedef NS_ENUM(NSUInteger, MPContextButtonSegment) {
};
@property (nonatomic, strong) NSMenu *contextMenu;
- (void)setImage:(NSImage *)image;
@property (nonatomic, strong) NSImage *image;
@end

View File

@@ -91,6 +91,10 @@
[self setImage:image forSegment:MPContextButtonSegmentButton];
}
- (NSImage *)image {
return [self imageForSegment:MPContextButtonSegmentButton];
}
- (void)showContextMenu:(id)sender {
NSPoint point = self.frame.origin;
point.x = [self.cell widthForSegment:MPContextButtonSegmentButton];