gtchance / PopStatusItem

Status bar item with NSPopover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PopStatusItem

Shows an NSPopover from the status bar. Works with Mission Control and Spaces. Supports dark mode.

Screenshot

Installation

CocoaPods:

platform :osx, '10.10'
use_frameworks!

pod 'PopStatusItem'

Carthage:

github 'adamhartford/PopStatusItem'

Usage

let popStatusItem = PopStatusItem(image: NSImage(named: "buttonImage")!)

func applicationDidFinishLaunching(aNotification: NSNotification) {
    let storyboard = NSStoryboard(name: "Main", bundle: nil)
    popStatusItem.windowController = storyboard.instantiateControllerWithIdentifier("PopStatusItem") as? NSWindowController
}

// Manual actions
popStatusItem.togglePopover()
popStatusItem.showPopover()
popStatusItem.hidePopover()

Options

popStatusItem.highlight = true // Highlights status bar icon. Default is false.
popStatusItem.activate = true // Makes popover window active. Default is false.

Usage, or to recreate the demo application:

  1. Add LSUIElement=YES to Info.plist.
  2. Uncheck "Is Initial Controller" in Main.storyboard window controller.

License

PopDatePicker is released under the MIT license. See LICENSE for details.

About

Status bar item with NSPopover

License:MIT License


Languages

Language:Swift 86.1%Language:Ruby 7.1%Language:Objective-C 6.7%