mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: enabled selecting public IP address in portal view (#1927)
This commit is contained in:
@@ -351,7 +351,7 @@ public func popupRow(_ view: NSView, n: CGFloat = 0, title: String, value: Strin
|
||||
return (labelView, valueView)
|
||||
}
|
||||
|
||||
public func portalRow(_ v: NSStackView, title: String, value: String = "") -> ValueField {
|
||||
public func portalRow(_ v: NSStackView, title: String, value: String = "", isSelectable: Bool = false) -> ValueField {
|
||||
let view: NSStackView = NSStackView()
|
||||
view.orientation = .horizontal
|
||||
view.distribution = .fillProportionally
|
||||
@@ -361,6 +361,7 @@ public func portalRow(_ v: NSStackView, title: String, value: String = "") -> Va
|
||||
labelView.font = NSFont.systemFont(ofSize: 11, weight: .regular)
|
||||
|
||||
let valueView: ValueField = ValueField(value)
|
||||
valueView.isSelectable = isSelectable
|
||||
valueView.font = NSFont.systemFont(ofSize: 12, weight: .regular)
|
||||
|
||||
view.addArrangedSubview(labelView)
|
||||
|
||||
@@ -82,7 +82,7 @@ public class Portal: PortalWrapper {
|
||||
self.chart = chart
|
||||
view.addArrangedSubview(container)
|
||||
|
||||
self.publicIPField = portalRow(view, title: "\(localizedString("Public IP")):", value: localizedString("Unknown"))
|
||||
self.publicIPField = portalRow(view, title: "\(localizedString("Public IP")):", value: localizedString("Unknown"), isSelectable: true)
|
||||
view.subviews.last?.heightAnchor.constraint(equalToConstant: 16).isActive = true
|
||||
|
||||
self.addArrangedSubview(view)
|
||||
|
||||
Reference in New Issue
Block a user