From 2c2689eed0a54a44901e425967901ad098314255 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 3 May 2024 13:24:55 +0200 Subject: [PATCH] feat: enabled selecting public IP address in portal view (#1927) --- Kit/helpers.swift | 3 ++- Modules/Net/portal.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Kit/helpers.swift b/Kit/helpers.swift index c636ffdf..2a170ea5 100644 --- a/Kit/helpers.swift +++ b/Kit/helpers.swift @@ -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) diff --git a/Modules/Net/portal.swift b/Modules/Net/portal.swift index 956a50b1..8fcc7f34 100644 --- a/Modules/Net/portal.swift +++ b/Modules/Net/portal.swift @@ -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)