feat: updated GPU portal view

This commit is contained in:
Serhiy Mytrovtsiy
2024-01-23 19:12:14 +01:00
parent 7ed9b9f4d3
commit b392a9732c
3 changed files with 85 additions and 29 deletions

View File

@@ -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))