feat: enabled selecting public IP address in portal view (#1927)

This commit is contained in:
Serhiy Mytrovtsiy
2024-05-03 13:24:55 +02:00
parent 499a30ff89
commit 2c2689eed0
2 changed files with 3 additions and 2 deletions

View File

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

View File

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