mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-07 03:40:09 +00:00
Popovers now appear to work
This commit is contained in:
parent
683ba79ff0
commit
3d9a5a4f91
@ -114,9 +114,20 @@
|
||||
}
|
||||
|
||||
- (void)showNetworks {
|
||||
if(self.statusItem.button != nil) {
|
||||
NSStatusBarButton *button = self.statusItem.button;
|
||||
[self.networkListPopover showRelativeToRect:button.bounds
|
||||
NSButton *button = nil;
|
||||
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.networkListPopover showRelativeToRect:frame
|
||||
ofView:button
|
||||
preferredEdge:NSMinYEdge];
|
||||
|
||||
@ -129,12 +140,22 @@
|
||||
[self.networkListPopover close];
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)joinNetwork {
|
||||
if(self.statusItem.button != nil) {
|
||||
NSStatusBarButton *button = self.statusItem.button;
|
||||
NSButton *button = nil;
|
||||
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
|
||||
ofView:button
|
||||
preferredEdge:NSMinYEdge];
|
||||
@ -147,12 +168,22 @@
|
||||
[self.joinNetworkPopover close];
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showPreferences {
|
||||
if(self.statusItem.button != nil) {
|
||||
NSStatusBarButton *button = self.statusItem.button;
|
||||
NSButton *button = nil;
|
||||
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
|
||||
ofView:button
|
||||
preferredEdge:NSMinYEdge];
|
||||
@ -164,12 +195,22 @@
|
||||
[self.preferencesPopover close];
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showAbout {
|
||||
if(self.statusItem.button != nil) {
|
||||
NSStatusBarButton *button = self.statusItem.button;
|
||||
NSButton *button = nil;
|
||||
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
|
||||
ofView:button
|
||||
preferredEdge:NSMinYEdge];
|
||||
@ -181,8 +222,6 @@
|
||||
[self.aboutPopover close];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)quit {
|
||||
|
Loading…
x
Reference in New Issue
Block a user