mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-03 01:02:52 +00:00
Popovers now appear to work
This commit is contained in:
parent
683ba79ff0
commit
3d9a5a4f91
@ -114,9 +114,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)showNetworks {
|
- (void)showNetworks {
|
||||||
if(self.statusItem.button != nil) {
|
NSButton *button = nil;
|
||||||
NSStatusBarButton *button = self.statusItem.button;
|
NSRect frame;
|
||||||
[self.networkListPopover showRelativeToRect:button.bounds
|
if ([self.statusItem respondsToSelector:@selector(button)]) {
|
||||||
|
button = self.statusItem.button;
|
||||||
|
frame = button.bounds;
|
||||||
|
} else if ([self.statusItem respondsToSelector:@selector(_button)]) {
|
||||||
|
button = [self.statusItem performSelector:@selector(_button)];
|
||||||
|
frame = button.bounds;
|
||||||
|
} else {
|
||||||
|
NSLog(@"Can't get view. Uh oh.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[self.networkListPopover showRelativeToRect:frame
|
||||||
ofView:button
|
ofView:button
|
||||||
preferredEdge:NSMinYEdge];
|
preferredEdge:NSMinYEdge];
|
||||||
|
|
||||||
@ -130,11 +141,21 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
- (void)joinNetwork {
|
- (void)joinNetwork {
|
||||||
if(self.statusItem.button != nil) {
|
NSButton *button = nil;
|
||||||
NSStatusBarButton *button = self.statusItem.button;
|
NSRect frame;
|
||||||
|
if ([self.statusItem respondsToSelector:@selector(button)]) {
|
||||||
|
button = self.statusItem.button;
|
||||||
|
frame = button.bounds;
|
||||||
|
} else if ([self.statusItem respondsToSelector:@selector(_button)]) {
|
||||||
|
button = [self.statusItem performSelector:@selector(_button)];
|
||||||
|
frame = button.bounds;
|
||||||
|
} else {
|
||||||
|
NSLog(@"Can't get view. Uh oh.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[self.joinNetworkPopover showRelativeToRect:button.bounds
|
[self.joinNetworkPopover showRelativeToRect:button.bounds
|
||||||
ofView:button
|
ofView:button
|
||||||
preferredEdge:NSMinYEdge];
|
preferredEdge:NSMinYEdge];
|
||||||
@ -148,11 +169,21 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
- (void)showPreferences {
|
- (void)showPreferences {
|
||||||
if(self.statusItem.button != nil) {
|
NSButton *button = nil;
|
||||||
NSStatusBarButton *button = self.statusItem.button;
|
NSRect frame;
|
||||||
|
if ([self.statusItem respondsToSelector:@selector(button)]) {
|
||||||
|
button = self.statusItem.button;
|
||||||
|
frame = button.bounds;
|
||||||
|
} else if ([self.statusItem respondsToSelector:@selector(_button)]) {
|
||||||
|
button = [self.statusItem performSelector:@selector(_button)];
|
||||||
|
frame = button.bounds;
|
||||||
|
} else {
|
||||||
|
NSLog(@"Can't get view. Uh oh.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[self.preferencesPopover showRelativeToRect:button.bounds
|
[self.preferencesPopover showRelativeToRect:button.bounds
|
||||||
ofView:button
|
ofView:button
|
||||||
preferredEdge:NSMinYEdge];
|
preferredEdge:NSMinYEdge];
|
||||||
@ -165,11 +196,21 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
- (void)showAbout {
|
- (void)showAbout {
|
||||||
if(self.statusItem.button != nil) {
|
NSButton *button = nil;
|
||||||
NSStatusBarButton *button = self.statusItem.button;
|
NSRect frame;
|
||||||
|
if ([self.statusItem respondsToSelector:@selector(button)]) {
|
||||||
|
button = self.statusItem.button;
|
||||||
|
frame = button.bounds;
|
||||||
|
} else if ([self.statusItem respondsToSelector:@selector(_button)]) {
|
||||||
|
button = [self.statusItem performSelector:@selector(_button)];
|
||||||
|
frame = button.bounds;
|
||||||
|
} else {
|
||||||
|
NSLog(@"Can't get view. Uh oh.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[self.aboutPopover showRelativeToRect:button.bounds
|
[self.aboutPopover showRelativeToRect:button.bounds
|
||||||
ofView:button
|
ofView:button
|
||||||
preferredEdge:NSMinYEdge];
|
preferredEdge:NSMinYEdge];
|
||||||
@ -183,8 +224,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)quit {
|
- (void)quit {
|
||||||
[NSApp performSelector:@selector(terminate:) withObject:nil afterDelay:0.0];
|
[NSApp performSelector:@selector(terminate:) withObject:nil afterDelay:0.0];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user