|
@@ -24,11 +24,11 @@ class KMUserFbEmailItemView: NSView, NibLoadable {
|
|
|
|
|
|
self.titleLabel.attributedStringValue = attri
|
|
|
|
|
|
- self.box.borderWidth = 0
|
|
|
-// self.box.borderColor = NSColor(white: 0, alpha: 0.2)
|
|
|
-// self.box.fillColor = .white
|
|
|
+ self.box.borderWidth = 1
|
|
|
+ self.box.borderColor = NSColor(white: 0, alpha: 0.2)
|
|
|
+ self.box.fillColor = .white
|
|
|
self.textfiled.drawsBackground = false
|
|
|
-// self.textfiled.isBordered = false
|
|
|
+ self.textfiled.isBordered = false
|
|
|
// self.textfiled.focusRingType = .none
|
|
|
self.textfiled.placeholderString = NSLocalizedString("Your email", comment: "")
|
|
|
self.textfiled.delegate = self
|
|
@@ -36,9 +36,13 @@ class KMUserFbEmailItemView: NSView, NibLoadable {
|
|
|
self.textfiled.layer?.cornerRadius = 4
|
|
|
self.textfiled.layer?.masksToBounds = true
|
|
|
|
|
|
-// self.textfiled.firstResponderHandler = { [weak self] result in
|
|
|
-// self?.box.borderColor = NSColor(red: 140/255.0, green: 131/255.0, blue: 1.0, alpha: 1.0)
|
|
|
-// }
|
|
|
+ self.textfiled.firstResponderHandler = { [weak self] result in
|
|
|
+ if result {
|
|
|
+ self?.box.borderColor = NSColor.km_init(hex: "#1770F4")
|
|
|
+ } else {
|
|
|
+ self?.box.borderColor = NSColor(white: 0, alpha: 0.2)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
self.tipLabel.textColor = NSColor.km_init(hex: "#FA1E5D")
|
|
@@ -72,6 +76,12 @@ extension KMUserFbEmailItemView: NSTextFieldDelegate {
|
|
|
func controlTextDidBeginEditing(_ obj: Notification) {
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ func controlTextDidEndEditing(_ obj: Notification) {
|
|
|
+ if self.textfiled.isEqual(to: obj.object) {
|
|
|
+ self.box.borderColor = NSColor(white: 0, alpha: 0.2)
|
|
|
+ }
|
|
|
+ }
|
|
|
func controlTextDidChange(_ obj: Notification) {
|
|
|
if self.textfiled.isEqual(to: obj.object) {
|
|
|
self.hiddenTip()
|