     
     var lastStyle : Int = 0
     var lastTitle = "Helium"
-    var autoHideTitle : Bool = NSUserDefaults.standardUserDefaults().boolForKey(UserSetting.AutoHideTitle.userDefaultsKey)
+	var appDelegate: AppDelegate = NSApp.delegate as! AppDelegate
 
     override func mouseExited(theEvent: NSEvent) {
-        if autoHideTitle {
+        if appDelegate.autoHideTitle {
             if lastStyle == 0 { lastStyle = (self.view.window?.styleMask)! }
             self.view.window!.titleVisibility = NSWindowTitleVisibility.Hidden;
             self.view.window?.styleMask = NSBorderlessWindowMask
         }
     }
     override func mouseEntered(theEvent: NSEvent) {
-        if autoHideTitle {
+        if appDelegate.autoHideTitle {
             if lastStyle == 0 { lastStyle = (self.view.window?.styleMask)! }
             self.view.window!.titleVisibility = NSWindowTitleVisibility.Visible;
             self.view.window?.styleMask = lastStyle

		subOpen.addItem(item)

		item = NSMenuItem(title: "Location", action: #selector(HeliumPanelController.openLocationPress(_:)), keyEquivalent: "")
		item.target = self.window?.windowController
		subOpen.addItem(item)

		subMenu.addItem(NSMenuItem.separatorItem())

		item = NSMenuItem(title: "Float Above All Spaces", action: #selector(HeliumPanelController.floatOverFullScreenAppsToggled(_:)), keyEquivalent: "")
		item.state = 1 - NSUserDefaults.standardUserDefaults().integerForKey(UserSetting.DisabledFullScreenFloat.userDefaultsKey)
		item.target = wc
		subMenu.addItem(item)
		
		item = NSMenuItem(title: "Magic URL Redirects", action: #selector(AppDelegate.magicURLRedirectToggled(_:)), keyEquivalent: "")
		item.state = 1 - NSUserDefaults.standardUserDefaults().integerForKey(UserSetting.DisabledMagicURLs.userDefaultsKey)
		item.target = NSApp.delegate
		subMenu.addItem(item)

		item = NSMenuItem(title: "Title Bar", action: #selector(menuClicked(_:)), keyEquivalent: "")
		subMenu.addItem(item)
		let subTitleBar = NSMenu()
		item.submenu = subTitleBar

		item = NSMenuItem(title: "Auto Hide", action: #selector(HeliumPanelController.autoHideTitle(_:)), keyEquivalent: "b")
		item.state = NSUserDefaults.standardUserDefaults().integerForKey(UserSetting.AutoHideTitle.userDefaultsKey)
		item.target = wc
		subTitleBar.addItem(item)

		item = NSMenuItem(title: "Translucency", action: #selector(menuClicked(_:)), keyEquivalent: "")
		subMenu.addItem(item)
		let subTranslucency = NSMenu()
		item.submenu = subTranslucency

		item = NSMenuItem(title: "Enabled", action: #selector(HeliumPanelController.translucencyPress(_:)), keyEquivalent: "t")
		item.state = wc.translucencyEnabled == true ? NSOnState : NSOffState
		item.target = wc
		subTranslucency.addItem(item)

		let subOpacity = NSMenu()
		item.submenu = subOpacity

		item = NSMenuItem(title: "10%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (10 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "20%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (20 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "30%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (30 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "40%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (40 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "50%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (50 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "60%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (60 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "70%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (70 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "80%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (80 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "90%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (90 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
		item = NSMenuItem(title: "100%", action: #selector(HeliumPanelController.percentagePress(_:)), keyEquivalent: "")
		item.state = (100 == opacity ? NSOnState : NSOffState)
		item.target = wc
		subOpacity.addItem(item)
