mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-02-02 22:51:28 +01:00
52 lines
1.2 KiB
Swift
52 lines
1.2 KiB
Swift
|
//
|
||
|
// FixedWidthViews.swift
|
||
|
// Clover
|
||
|
//
|
||
|
// Created by vector sigma on 05/11/2019.
|
||
|
// Copyright © 2019 CloverHackyColor. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import Cocoa
|
||
|
|
||
|
class FWPopUpButton: NSPopUpButton {
|
||
|
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)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class FWButton: NSButton {
|
||
|
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)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class FWTextField: NSTextField {
|
||
|
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)
|
||
|
}
|
||
|
}
|