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; @property (nonatomic, strong) NSMenu *contextMenu;
@property (nonatomic, strong) NSImage *image;
- (void)setImage:(NSImage *)image;
@end @end

View File

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