From 9c8231dcf74f92300001116954e231947d7cd0aa Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 18 Mar 2019 09:03:04 +0530 Subject: on-demand: macOS: Remove unused class ControlRow Signed-off-by: Roopesh Chander --- WireGuard/WireGuard.xcodeproj/project.pbxproj | 4 -- WireGuard/WireGuard/UI/macOS/View/ControlRow.swift | 61 ---------------------- 2 files changed, 65 deletions(-) delete mode 100644 WireGuard/WireGuard/UI/macOS/View/ControlRow.swift diff --git a/WireGuard/WireGuard.xcodeproj/project.pbxproj b/WireGuard/WireGuard.xcodeproj/project.pbxproj index e2caa22..6e1b17e 100644 --- a/WireGuard/WireGuard.xcodeproj/project.pbxproj +++ b/WireGuard/WireGuard.xcodeproj/project.pbxproj @@ -77,7 +77,6 @@ 6F7774EF21722D97006A79B3 /* TunnelsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7774EE21722D97006A79B3 /* TunnelsManager.swift */; }; 6F7774F321774263006A79B3 /* TunnelEditTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7774F221774263006A79B3 /* TunnelEditTableViewController.swift */; }; 6F7F7E5F21C7D74B00527607 /* TunnelErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7F7E5E21C7D74B00527607 /* TunnelErrors.swift */; }; - 6F86476B222FBB07006925D9 /* ControlRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F864769222FB87C006925D9 /* ControlRow.swift */; }; 6F89E17A21EDEB0E00C97BB9 /* StatusItemController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F89E17921EDEB0E00C97BB9 /* StatusItemController.swift */; }; 6F89E17C21F090CC00C97BB9 /* TunnelsTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F89E17B21F090CC00C97BB9 /* TunnelsTracker.swift */; }; 6F8F0D7122258153000E8335 /* ActivateOnDemandViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F8F0D7022258153000E8335 /* ActivateOnDemandViewModel.swift */; }; @@ -302,7 +301,6 @@ 6F7774EE21722D97006A79B3 /* TunnelsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelsManager.swift; sourceTree = ""; }; 6F7774F221774263006A79B3 /* TunnelEditTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelEditTableViewController.swift; sourceTree = ""; }; 6F7F7E5E21C7D74B00527607 /* TunnelErrors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelErrors.swift; sourceTree = ""; }; - 6F864769222FB87C006925D9 /* ControlRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlRow.swift; sourceTree = ""; }; 6F89E17921EDEB0E00C97BB9 /* StatusItemController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusItemController.swift; sourceTree = ""; }; 6F89E17B21F090CC00C97BB9 /* TunnelsTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelsTracker.swift; sourceTree = ""; }; 6F8F0D7022258153000E8335 /* ActivateOnDemandViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivateOnDemandViewModel.swift; sourceTree = ""; }; @@ -447,7 +445,6 @@ 5F52D0BC21E3785C00283CEA /* ConfTextStorage.swift */, 6FE3661C21F64F6B00F78C7D /* ConfTextColorTheme.swift */, 6F5EA59A223E58A8002B380A /* ButtonRow.swift */, - 6F864769222FB87C006925D9 /* ControlRow.swift */, 6FB17945222FD5960018AE71 /* OnDemandWiFiControls.swift */, ); path = View; @@ -1203,7 +1200,6 @@ 6FFACD2021E4D8D500E9A2A5 /* ParseError+WireGuardAppError.swift in Sources */, 6FB1BDC021D50F0200A991BF /* NETunnelProviderProtocol+Extension.swift in Sources */, 6FBA101821D656000051C35F /* StatusMenu.swift in Sources */, - 6F86476B222FBB07006925D9 /* ControlRow.swift in Sources */, 6F613D9B21DE33B8004B217A /* KeyValueRow.swift in Sources */, 6FB1BDC121D50F0200A991BF /* String+ArrayConversion.swift in Sources */, 5F52D0BB21E3781B00283CEA /* ConfTextView.swift in Sources */, diff --git a/WireGuard/WireGuard/UI/macOS/View/ControlRow.swift b/WireGuard/WireGuard/UI/macOS/View/ControlRow.swift deleted file mode 100644 index 7759073..0000000 --- a/WireGuard/WireGuard/UI/macOS/View/ControlRow.swift +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright © 2018-2019 WireGuard LLC. All Rights Reserved. - -import Cocoa - -class ControlRow: NSView { - let keyLabel: NSTextField = { - let keyLabel = NSTextField() - keyLabel.isEditable = false - keyLabel.isSelectable = false - keyLabel.isBordered = false - keyLabel.alignment = .right - keyLabel.maximumNumberOfLines = 1 - keyLabel.lineBreakMode = .byTruncatingTail - keyLabel.backgroundColor = .clear - return keyLabel - }() - - var key: String { - get { return keyLabel.stringValue } - set(value) { keyLabel.stringValue = value } - } - - override var intrinsicContentSize: NSSize { - let height = max(keyLabel.intrinsicContentSize.height, controlView.intrinsicContentSize.height) - return NSSize(width: NSView.noIntrinsicMetric, height: height) - } - - let controlView: NSView - - init(controlView: NSView) { - self.controlView = controlView - super.init(frame: CGRect.zero) - - addSubview(keyLabel) - addSubview(controlView) - keyLabel.translatesAutoresizingMaskIntoConstraints = false - controlView.translatesAutoresizingMaskIntoConstraints = false - - NSLayoutConstraint.activate([ - keyLabel.centerYAnchor.constraint(equalTo: self.centerYAnchor), - self.leadingAnchor.constraint(equalTo: keyLabel.leadingAnchor), - keyLabel.trailingAnchor.constraint(equalTo: controlView.leadingAnchor, constant: -5) - ]) - - keyLabel.setContentCompressionResistancePriority(.defaultHigh + 2, for: .horizontal) - keyLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) - - let widthConstraint = keyLabel.widthAnchor.constraint(equalToConstant: 150) - widthConstraint.priority = .defaultHigh + 1 - widthConstraint.isActive = true - } - - required init?(coder decoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func prepareForReuse() { - key = "" - } -} -- cgit v1.2.3-59-g8ed1b