Tweak password font
This commit is contained in:
parent
6ea47766bc
commit
3605e59c30
4 changed files with 8 additions and 5 deletions
|
|
@ -25,7 +25,7 @@ class FillPasswordTableViewCell: ContentTableViewCell {
|
||||||
override func awakeFromNib() {
|
override func awakeFromNib() {
|
||||||
super.awakeFromNib()
|
super.awakeFromNib()
|
||||||
// Initialization code
|
// Initialization code
|
||||||
contentTextField.font = UIFont(name: Globals.passwordFonts, size: (contentTextField.font?.pointSize)!)
|
contentTextField.font = Globals.passwordFont
|
||||||
|
|
||||||
// Force aspect ratio of button images
|
// Force aspect ratio of button images
|
||||||
settingButton.imageView?.contentMode = .scaleAspectFit
|
settingButton.imageView?.contentMode = .scaleAspectFit
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class LabelTableViewCell: UITableViewCell {
|
||||||
contentLabel.text = Globals.passwordDots
|
contentLabel.text = Globals.passwordDots
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contentLabel.font = UIFont(name: Globals.passwordFonts, size: contentLabel.font.pointSize)
|
contentLabel.font = Globals.passwordFont
|
||||||
case "hmac-based":
|
case "hmac-based":
|
||||||
type = .HOTP
|
type = .HOTP
|
||||||
if isReveal {
|
if isReveal {
|
||||||
|
|
@ -59,7 +59,7 @@ class LabelTableViewCell: UITableViewCell {
|
||||||
} else {
|
} else {
|
||||||
contentLabel.text = Globals.oneTimePasswordDots
|
contentLabel.text = Globals.oneTimePasswordDots
|
||||||
}
|
}
|
||||||
contentLabel.font = UIFont(name: Globals.passwordFonts, size: contentLabel.font.pointSize)
|
contentLabel.font = Globals.passwordFont
|
||||||
case "url":
|
case "url":
|
||||||
type = .URL
|
type = .URL
|
||||||
contentLabel.text = content
|
contentLabel.text = content
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,13 @@ public class Globals {
|
||||||
|
|
||||||
public static let passwordDots = "••••••••••••"
|
public static let passwordDots = "••••••••••••"
|
||||||
public static let oneTimePasswordDots = "••••••"
|
public static let oneTimePasswordDots = "••••••"
|
||||||
public static let passwordFonts = "Courier"
|
public static let passwordFont = UIFont(name: "Courier-Bold", size: UIFont.labelFontSize - 1)
|
||||||
|
|
||||||
// UI related
|
// UI related
|
||||||
public static let red = UIColor(red:1.00, green:0.23, blue:0.19, alpha:1.0)
|
public static let red = UIColor(red:1.00, green:0.23, blue:0.19, alpha:1.0)
|
||||||
public static let blue = UIColor(red:0.00, green:0.48, blue:1.00, alpha:1.0)
|
public static let blue = UIColor(red:0.00, green:0.48, blue:1.00, alpha:1.0)
|
||||||
public static let letterColor = UIColor(red:200/255.0, green:40/255.0, blue:41/255.0, alpha:1.0)
|
public static let letterColor = UIColor(red:40/255.0, green:42/255.0, blue:54/255.0, alpha:1.0)
|
||||||
|
public static let symbolColor = UIColor(red:200/255.0, green:40/255.0, blue:41/255.0, alpha:1.0)
|
||||||
public static let digitColor = UIColor(red:66/255.0, green:113/255.0, blue:174/255.0, alpha:1.0)
|
public static let digitColor = UIColor(red:66/255.0, green:113/255.0, blue:174/255.0, alpha:1.0)
|
||||||
public static let tableCellButtonSize = CGFloat(20.0)
|
public static let tableCellButtonSize = CGFloat(20.0)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,8 @@ public class Utils {
|
||||||
if NSCharacterSet.decimalDigits.contains(element) {
|
if NSCharacterSet.decimalDigits.contains(element) {
|
||||||
charColor = Globals.digitColor
|
charColor = Globals.digitColor
|
||||||
} else if !NSCharacterSet.letters.contains(element) {
|
} else if !NSCharacterSet.letters.contains(element) {
|
||||||
|
charColor = Globals.symbolColor
|
||||||
|
} else {
|
||||||
charColor = Globals.letterColor
|
charColor = Globals.letterColor
|
||||||
}
|
}
|
||||||
attributedPassword.addAttribute(NSAttributedStringKey.foregroundColor, value: charColor, range: NSRange(location: index, length: 1))
|
attributedPassword.addAttribute(NSAttributedStringKey.foregroundColor, value: charColor, range: NSRange(location: index, length: 1))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue