2019-11-06 23:58:10 +01:00
|
|
|
//
|
|
|
|
// FixedWidthViews.swift
|
|
|
|
// Clover
|
|
|
|
//
|
|
|
|
// Created by vector sigma on 05/11/2019.
|
|
|
|
// Copyright © 2019 CloverHackyColor. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
2020-03-01 15:16:28 +01:00
|
|
|
final class FWPopUpButton: NSPopUpButton {
|
2019-11-06 23:58:10 +01:00
|
|
|
private var pfixedWidth : CGFloat = 50
|
|
|
|
@IBInspectable var fixedWidth: CGFloat {
|
|
|
|
get {
|
|
|
|
return self.pfixedWidth
|
|
|
|
} set {
|
|
|
|
self.pfixedWidth = newValue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
override var intrinsicContentSize: NSSize {
|
|
|
|
return NSMakeSize(self.fixedWidth, super.intrinsicContentSize.height)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-01 15:16:28 +01:00
|
|
|
final class FWButton: NSButton {
|
2019-11-06 23:58:10 +01:00
|
|
|
private var pfixedWidth : CGFloat = 50
|
|
|
|
@IBInspectable var fixedWidth: CGFloat {
|
|
|
|
get {
|
|
|
|
return self.pfixedWidth
|
|
|
|
} set {
|
|
|
|
self.pfixedWidth = newValue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
override var intrinsicContentSize: NSSize {
|
|
|
|
return NSMakeSize(self.fixedWidth, super.intrinsicContentSize.height)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-01 15:16:28 +01:00
|
|
|
final class FWTextField: NSTextField {
|
2019-11-06 23:58:10 +01:00
|
|
|
private var pfixedWidth : CGFloat = 50
|
|
|
|
@IBInspectable var fixedWidth: CGFloat {
|
|
|
|
get {
|
|
|
|
return self.pfixedWidth
|
|
|
|
} set {
|
|
|
|
self.pfixedWidth = newValue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
override var intrinsicContentSize: NSSize {
|
|
|
|
return NSMakeSize(self.fixedWidth, super.intrinsicContentSize.height)
|
|
|
|
}
|
|
|
|
}
|