Bläddra i källkod

set contact-request background color

B. Petersen 5 år sedan
förälder
incheckning
20d353f0b2
2 ändrade filer med 15 tillägg och 2 borttagningar
  1. 14 2
      deltachat-ios/Controller/ChatListController.swift
  2. 1 0
      deltachat-ios/Helper/Colors.swift

+ 14 - 2
deltachat-ios/Controller/ChatListController.swift

@@ -154,7 +154,9 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
         }
 
         let cell: ContactCell
-        if let c = tableView.dequeueReusableCell(withIdentifier: "ChatCell") as? ContactCell {
+        if chatId == DC_CHAT_ID_DEADDROP {
+            cell = getDeaddropCell(tableView)
+        } else if let c = tableView.dequeueReusableCell(withIdentifier: "ChatCell") as? ContactCell {
             cell = c
         } else {
             cell = ContactCell(style: .default, reuseIdentifier: "ChatCell")
@@ -168,7 +170,6 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
             NSAttributedString(string: chat.name, attributes: [ .font: UIFont.systemFont(ofSize: 16, weight: .bold) ]) :
             NSAttributedString(string: chat.name, attributes: [ .font: UIFont.systemFont(ofSize: 16, weight: .medium) ])
 
-
         if let img = chat.profileImage {
             cell.resetBackupImage()
             cell.setImage(img)
@@ -253,6 +254,17 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
         return [archive, delete]
     }
 
+    func getDeaddropCell(_ tableView: UITableView) -> ContactCell {
+        let deaddropCell: ContactCell
+        if let cell = tableView.dequeueReusableCell(withIdentifier: "DeaddropCell") as? ContactCell {
+            deaddropCell = cell
+        } else {
+            deaddropCell = ContactCell(style: .default, reuseIdentifier: "DeaddropCell")
+        }
+        deaddropCell.backgroundColor = DcColors.deaddropBackground // TODO: why is the color not changed in darkmode?
+        return deaddropCell
+    }
+
     func getArchiveCell(_ tableView: UITableView) -> UITableViewCell {
         let archiveCell: UITableViewCell
         if let cell = tableView.dequeueReusableCell(withIdentifier: "ArchiveCell") {

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

@@ -17,6 +17,7 @@ struct DcColors {
     static let placeholderColor = UIColor.themeColor(light: UIColor(red: 0.6, green: 0.6, blue: 0.6, alpha: 1),
                                                      dark: UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1))
     static let systemMessageBackgroundColor = UIColor.themeColor(light: UIColor.rgb(red: 248, green: 248, blue: 248), dark: UIColor(white: 0.2, alpha: 0.5))
+    static let deaddropBackground = UIColor.themeColor(light: UIColor.init(hexString: "ebebec"), dark: UIColor.init(hexString: "1a1a1c"))
 }
 
 enum SystemColor {