mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
feat: added activity chart per disk to the Disk popup (#827)
This commit is contained in:
@@ -14,7 +14,7 @@ import Kit
|
||||
|
||||
internal class Popup: NSStackView, Popup_p {
|
||||
public var sizeCallback: ((NSSize) -> Void)? = nil
|
||||
private let emptyView: EmptyView = EmptyView(height: 30, isHidden: false)
|
||||
private let emptyView: EmptyView = EmptyView(height: 30, isHidden: false, msg: localizedString("No Bluetooth devices are available"))
|
||||
|
||||
public init() {
|
||||
super.init(frame: NSRect(x: 0, y: 0, width: Constants.Popup.width, height: 30))
|
||||
|
||||
@@ -16,7 +16,7 @@ internal class Settings: NSStackView, Settings_v {
|
||||
public var callback: (() -> Void) = {}
|
||||
|
||||
private var list: [String: Bool] = [:]
|
||||
private let emptyView: EmptyView = EmptyView()
|
||||
private let emptyView: EmptyView = EmptyView(msg: localizedString("No Bluetooth devices are available"))
|
||||
|
||||
public init() {
|
||||
super.init(frame: NSRect(x: 0, y: 0, width: 0, height: 0))
|
||||
@@ -84,32 +84,3 @@ internal class Settings: NSStackView, Settings_v {
|
||||
self.callback()
|
||||
}
|
||||
}
|
||||
|
||||
internal class EmptyView: NSStackView {
|
||||
public init(height: CGFloat = 120, isHidden: Bool = false) {
|
||||
super.init(frame: NSRect())
|
||||
|
||||
self.heightAnchor.constraint(equalToConstant: height).isActive = true
|
||||
|
||||
self.translatesAutoresizingMaskIntoConstraints = true
|
||||
self.orientation = .vertical
|
||||
self.distribution = .fillEqually
|
||||
self.isHidden = isHidden
|
||||
self.identifier = NSUserInterfaceItemIdentifier(rawValue: "emptyView")
|
||||
|
||||
let textView: NSTextView = NSTextView()
|
||||
textView.heightAnchor.constraint(equalToConstant: (height/2)+6).isActive = true
|
||||
textView.alignment = .center
|
||||
textView.isEditable = false
|
||||
textView.isSelectable = false
|
||||
textView.drawsBackground = false
|
||||
textView.string = localizedString("No Bluetooth devices are available")
|
||||
|
||||
self.addArrangedSubview(NSView())
|
||||
self.addArrangedSubview(textView)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user