mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: updated GPU portal view
This commit is contained in:
@@ -350,6 +350,29 @@ public func popupRow(_ view: NSView, n: CGFloat = 0, title: String, value: Strin
|
||||
return (labelView, valueView)
|
||||
}
|
||||
|
||||
public func portalRow(_ v: NSStackView, title: String) -> ValueField {
|
||||
let view: NSStackView = NSStackView()
|
||||
view.orientation = .horizontal
|
||||
view.distribution = .fillProportionally
|
||||
view.spacing = 1
|
||||
|
||||
let labelView: LabelField = LabelField(title)
|
||||
labelView.font = NSFont.systemFont(ofSize: 11, weight: .regular)
|
||||
|
||||
let valueView: ValueField = ValueField()
|
||||
valueView.font = NSFont.systemFont(ofSize: 12, weight: .regular)
|
||||
|
||||
view.addArrangedSubview(labelView)
|
||||
view.addArrangedSubview(NSView())
|
||||
view.addArrangedSubview(valueView)
|
||||
|
||||
v.addArrangedSubview(view)
|
||||
|
||||
view.widthAnchor.constraint(equalTo: v.widthAnchor).isActive = true
|
||||
|
||||
return valueView
|
||||
}
|
||||
|
||||
public func popupWithColorRow(_ view: NSView, color: NSColor, n: CGFloat, title: String, value: String) -> (NSView, LabelField, ValueField) {
|
||||
let rowView: NSView = NSView(frame: NSRect(x: 0, y: 22*n, width: view.frame.width, height: 22))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user