Browse Source

tweak lock color and size

B. Petersen 5 years ago
parent
commit
bbcd8c0215

+ 2 - 2
deltachat-ios/Assets.xcassets/ic_lock.imageset/Contents.json

@@ -12,7 +12,7 @@
     },
     {
       "idiom" : "universal",
-      "filename" : "ic_lock_lighergrey_3x.png",
+      "filename" : "ic_lock_lightergrey_3x.png",
       "scale" : "3x"
     }
   ],
@@ -20,4 +20,4 @@
     "version" : 1,
     "author" : "xcode"
   }
-}
+}

BIN
deltachat-ios/Assets.xcassets/ic_lock.imageset/ic_lock_lighergrey_3x.png


BIN
deltachat-ios/Assets.xcassets/ic_lock.imageset/ic_lock_lightergrey_1x.png


BIN
deltachat-ios/Assets.xcassets/ic_lock.imageset/ic_lock_lightergrey_2x.png


BIN
deltachat-ios/Assets.xcassets/ic_lock.imageset/ic_lock_lightergrey_3x.png


+ 6 - 6
deltachat-ios/Controller/ChatViewController.swift

@@ -780,7 +780,7 @@ extension ChatViewController: MessagesDataSource {
 
         var timestampAttributes: [NSAttributedString.Key: Any] = [
             .font: UIFont.systemFont(ofSize: 12),
-            .foregroundColor: UIColor.lightGray,
+            .foregroundColor: DcColors.grayDateColor,
             .paragraphStyle: NSParagraphStyle()
         ]
 
@@ -793,6 +793,10 @@ extension ChatViewController: MessagesDataSource {
 
             text.append(NSAttributedString(string: m.formattedSentDate(), attributes: timestampAttributes))
 
+            if m.showPadlock() {
+                attachPadlock(to: text)
+            }
+
             // TODO: this should be replaced by the respective icons,
             // for accessibility, the a11y strings should be added
             var stateDescription: String
@@ -817,10 +821,6 @@ extension ChatViewController: MessagesDataSource {
                 ]
             ))
 
-            if m.showPadlock() {
-                attachPadlock(to: text)
-            }
-
             return text
         }
 
@@ -840,7 +840,7 @@ extension ChatViewController: MessagesDataSource {
 
     private func attachPadlock(to text: NSMutableAttributedString) {
         let imageAttachment = NSTextAttachment()
-        imageAttachment.image = UIImage(named: "ic_lock.png")
+        imageAttachment.image = UIImage(named: "ic_lock")
         imageAttachment.image?.accessibilityIdentifier = String.localized("encrypted_message")
         let imageString = NSMutableAttributedString(attachment: imageAttachment)
         imageString.addAttributes([NSAttributedString.Key.baselineOffset: -1], range: NSRange(location: 0, length: 1))

+ 1 - 0
deltachat-ios/Helper/Colors.swift

@@ -13,6 +13,7 @@ struct DcColors {
     static let checkmarkGreen = UIColor.themeColor(light: UIColor.rgb(red: 112, green: 177, blue: 92))
     static let defaultTextColor = UIColor.themeColor(light: .darkText, dark: .white)
     static let grayTextColor = UIColor.themeColor(light: .darkGray, dark: .lightGray)
+    static let grayDateColor = UIColor.themeColor(lightHex: "999999", darkHex: "bbbbbb") // slight variations of lightGray (#aaaaaa)
     static let secondaryTextColor = UIColor.themeColor(lightHex: "848ba7", darkHex: "a5abc0")
     static let inputFieldColor =  UIColor.themeColor(light: UIColor(red: 245 / 255, green: 245 / 255, blue: 245 / 255, alpha: 1),
                                                      dark: UIColor(red: 10 / 255, green: 10 / 255, blue: 10 / 255, alpha: 1))