mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 22:52:26 +00:00
more use of properties
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user