2016-08-30 23:25:34 +03:00
|
|
|
/**
|
|
|
|
* Tae Won Ha - http://taewon.de - @hataewon
|
|
|
|
* See LICENSE
|
|
|
|
*/
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
import PureLayout
|
|
|
|
import RxSwift
|
|
|
|
|
2016-09-01 21:10:40 +03:00
|
|
|
class OpenQuicklyWindowComponent: WindowComponent, NSWindowDelegate, NSTableViewDelegate, NSTableViewDataSource {
|
2016-09-02 19:22:40 +03:00
|
|
|
|
|
|
|
private let searchField = NSTextField(forAutoLayout: ())
|
2016-08-30 23:25:34 +03:00
|
|
|
|
|
|
|
init(source: Observable<Any>) {
|
|
|
|
super.init(source: source, nibName: "OpenQuicklyWindow")
|
2016-09-01 21:10:40 +03:00
|
|
|
|
|
|
|
self.window.delegate = self
|
2016-08-30 23:25:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
override func addViews() {
|
|
|
|
self.window.contentView?.addSubview(searchField)
|
2016-09-02 19:22:40 +03:00
|
|
|
self.searchField.autoPinEdgesToSuperviewEdgesWithInsets(NSEdgeInsets(top: 18, left: 18, bottom: 18, right: 18))
|
2016-09-01 21:10:40 +03:00
|
|
|
|
2016-09-02 19:22:40 +03:00
|
|
|
self.searchField.becomeFirstResponder()
|
2016-08-30 23:25:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
override func subscription(source source: Observable<Any>) -> Disposable {
|
|
|
|
return NopDisposable.instance
|
|
|
|
}
|
2016-09-02 19:22:40 +03:00
|
|
|
|
|
|
|
override func show() {
|
|
|
|
super.show()
|
|
|
|
|
|
|
|
self.searchField.becomeFirstResponder()
|
|
|
|
}
|
2016-08-30 23:25:34 +03:00
|
|
|
}
|