KS styling
This commit is contained in:
+14
-6
@@ -22,14 +22,18 @@ final class KilSwitchPanelView: NSView {
|
||||
|
||||
private enum Constants {
|
||||
|
||||
enum LocalizedString {
|
||||
static let killSwitchText = "connection.killswitch.text"
|
||||
}
|
||||
|
||||
enum Image {
|
||||
static let info = "info"
|
||||
}
|
||||
|
||||
enum Color {
|
||||
static let title = NSColor(calibratedRed: 124 / 255.0, green: 134 / 255.0, blue: 186 / 255.0, alpha: 1.0)
|
||||
static let background = NSColor(calibratedRed: 122 / 255.0, green: 134 / 255.0, blue: 190 / 255.0, alpha: 1.0)
|
||||
static let fill = NSColor.white
|
||||
static let title = NSColor(red: 124 / 255.0, green: 134 / 255.0, blue: 186 / 255.0, alpha: 1.0)
|
||||
static let fill = NSColor(red: 122 / 255.0, green: 134 / 255.0, blue: 190 / 255.0, alpha: 1.0)
|
||||
static let background = NSColor(red: 21 / 255.0, green: 25 / 255.0, blue: 53 / 255.0, alpha: 1.0)
|
||||
}
|
||||
|
||||
enum Font {
|
||||
@@ -58,7 +62,7 @@ final class KilSwitchPanelView: NSView {
|
||||
static let infoImageWidth: CGFloat = 19
|
||||
static let infoImageHeight: CGFloat = 21
|
||||
|
||||
static let switchWidth: CGFloat = 37
|
||||
static let switchWidth: CGFloat = 32
|
||||
static let switchHeight: CGFloat = 20
|
||||
static let switchTrailing: CGFloat = 26
|
||||
}
|
||||
@@ -80,7 +84,7 @@ final class KilSwitchPanelView: NSView {
|
||||
|
||||
self.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
self.isHidden = true
|
||||
//self.isHidden = true
|
||||
|
||||
self.createUI()
|
||||
self.activateLayout()
|
||||
@@ -111,6 +115,8 @@ final class KilSwitchPanelView: NSView {
|
||||
|
||||
let titleFont = NSFont(name: Constants.Font.Name.medium, size: Constants.Font.Size.title)
|
||||
let titleField = self.initializeTextField(color: Constants.Color.title, font: titleFont)
|
||||
titleField.stringValue = NSLocalizedString(Constants.LocalizedString.killSwitchText, comment: "")
|
||||
//
|
||||
self.titleField = titleField
|
||||
self.addSubview(titleField)
|
||||
|
||||
@@ -118,7 +124,9 @@ final class KilSwitchPanelView: NSView {
|
||||
self.infoView = infoView
|
||||
self.addSubview(infoView)
|
||||
|
||||
let switchToggle = self.initializeSwitchToggle(height: Constants.Geometry.switchHeight, fillColor: Constants.Color.fill, backColor: Constants.Color.background)
|
||||
let switchToggle = self.initializeSwitchToggle(height: Constants.Geometry.switchHeight,
|
||||
fillColor: Constants.Color.fill,
|
||||
backColor: Constants.Color.background)
|
||||
self.switchToggle = switchToggle
|
||||
self.addSubview(switchToggle)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user