2020-04-01 23:37:00 +00:00
|
|
|
//
|
|
|
|
// WindowStatusView.swift
|
|
|
|
// MongoView
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 4/1/20.
|
|
|
|
// Copyright © 2020 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
|
|
|
class WindowStatusView: NSView {
|
|
|
|
|
|
|
|
@IBOutlet weak var button: NSButton!
|
|
|
|
|
|
|
|
static func create() -> WindowStatusView {
|
|
|
|
let nib = NSNib(nibNamed: "WindowStatusView", bundle: .main)
|
|
|
|
var objects: NSArray? = NSArray()
|
|
|
|
nib?.instantiate(withOwner: nil, topLevelObjects: &objects)
|
|
|
|
return objects!.first(where: { $0 is WindowStatusView }) as! WindowStatusView
|
|
|
|
}
|
|
|
|
|
|
|
|
override func awakeFromNib() {
|
|
|
|
super.awakeFromNib()
|
|
|
|
|
|
|
|
(button.cell as! NSButtonCell).imageDimsWhenDisabled = false
|
2020-07-07 17:23:27 +00:00
|
|
|
button.font = .monospacedDigitSystemFont(ofSize: 13, weight: .regular)
|
2020-04-01 23:37:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func setText(_ text: String) {
|
|
|
|
button.title = text
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|