-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppDelegate.swift
37 lines (30 loc) · 1.03 KB
/
AppDelegate.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// AppDelegate.swift
// todolist
//
// Created by tasuku tozawa on 2016/10/28.
// Copyright © 2016年 tasuwo. All rights reserved.
//
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, PanelControllerDelegate {
@IBOutlet weak var window: NSWindow!
var menubarController: MenubarController!
var panelController: PanelController!
func applicationDidFinishLaunching(_ Notification: Notification) {
self.menubarController = MenubarController()
self.panelController = PanelController(delegate: self)
}
func togglePopover() {
if self.panelController.window!.isVisible {
self.menubarController.view.setHighlight(isHighlighted: false)
self.panelController.closePanel()
} else {
self.menubarController.view.setHighlight(isHighlighted: true)
self.panelController.openPanel()
}
}
func statusItemViewRectForPanelController() -> NSRect {
return self.menubarController.view.getRect()
}
}