more use of properties

This commit is contained in:
Michael Starke
2017-12-12 10:56:31 +01:00
parent 92c83e0fa0
commit 0f43afdb59

View File

@@ -110,7 +110,7 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
popupButton.bezelStyle = NSTexturedRoundedBezelStyle; popupButton.bezelStyle = NSTexturedRoundedBezelStyle;
popupButton.focusRingType = NSFocusRingTypeNone; popupButton.focusRingType = NSFocusRingTypeNone;
popupButton.title = @""; popupButton.title = @"";
[popupButton.cell setImageScaling:NSImageScaleProportionallyDown]; popupButton.imageScaling = NSImageScaleProportionallyUpOrDown;
[popupButton sizeToFit]; [popupButton sizeToFit];
NSRect newFrame = popupButton.frame; NSRect newFrame = popupButton.frame;
@@ -156,7 +156,7 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
NSMenuItem *menuRepresentation = [[NSMenuItem alloc] initWithTitle:itemLabel NSMenuItem *menuRepresentation = [[NSMenuItem alloc] initWithTitle:itemLabel
action:[self _actionForToolbarItemIdentifier:itemIdentifier] action:[self _actionForToolbarItemIdentifier:itemIdentifier]
keyEquivalent:@""]; keyEquivalent:@""];
[item setMenuFormRepresentation:menuRepresentation]; item.menuFormRepresentation = menuRepresentation;
} }
else if( [itemIdentifier isEqualToString:MPToolbarItemSearch]){ else if( [itemIdentifier isEqualToString:MPToolbarItemSearch]){
@@ -221,13 +221,13 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
- (void)registerNotificationsForDocument:(MPDocument *)document { - (void)registerNotificationsForDocument:(MPDocument *)document {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didExitSearch:) name:MPDocumentDidExitSearchNotification object:document]; [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didExitSearch:) name:MPDocumentDidExitSearchNotification object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didEnterSearch:) name:MPDocumentDidEnterSearchNotification object:document]; [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didEnterSearch:) name:MPDocumentDidEnterSearchNotification object:document];
} }
#pragma mark - NSSearchFieldDelegate #pragma mark - NSSearchFieldDelegate
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector { - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector {
if(commandSelector == @selector(moveDown:)) { if(commandSelector == @selector(insertNewline:)) {
[[NSApp targetForAction:@selector(focusEntries:) to:nil from:self] focusEntries:self]; [[NSApp targetForAction:@selector(focusEntries:) to:nil from:self] focusEntries:self];
} }
return NO; return NO;