فهرست منبع

tweak WebxdcGridCell design

cyberta 3 سال پیش
والد
کامیت
723b8c5029
2فایلهای تغییر یافته به همراه9 افزوده شده و 7 حذف شده
  1. 1 1
      deltachat-ios/Controller/WebxdcSelector.swift
  2. 8 6
      deltachat-ios/View/Cell/WebxdcGridCell.swift

+ 1 - 1
deltachat-ios/Controller/WebxdcSelector.swift

@@ -11,7 +11,7 @@ class WebxdcSelector: UIViewController {
     private let dcContext: DcContext
     // MARK: - data
     private var mediaMessageIds: [Int]
-    private var deduplicatedMessageHashes: [String : Int]
+    private var deduplicatedMessageHashes: [String: Int]
     private var deduplicatedMessageIds: [Int]
     private var items: [Int: GalleryItem] = [:]
 

+ 8 - 6
deltachat-ios/View/Cell/WebxdcGridCell.swift

@@ -13,6 +13,8 @@ class WebxdcGridCell: UICollectionViewCell {
         view.clipsToBounds = true
         view.isAccessibilityElement = false
         view.translatesAutoresizingMaskIntoConstraints = false
+        view.layer.cornerRadius = 6
+        view.clipsToBounds = true
         return view
     }()
 
@@ -22,7 +24,7 @@ class WebxdcGridCell: UICollectionViewCell {
         label.font = UIFont.preferredFont(for: .caption1, weight: .light)
         label.lineBreakMode = .byTruncatingTail
         label.textColor = DcColors.defaultInverseColor
-        label.backgroundColor = DcColors.defaultBackgroundColor
+        label.backgroundColor = DcColors.defaultTransparentBackgroundColor
         return label
     }()
 
@@ -46,15 +48,15 @@ class WebxdcGridCell: UICollectionViewCell {
 
     private func setupSubviews() {
         contentView.addSubview(imageView)
-        contentView.addSubview(descriptionLabel)
+        imageView.addSubview(descriptionLabel)
         addConstraints([
             imageView.constraintAlignLeadingToAnchor(contentView.leadingAnchor),
             imageView.constraintAlignTrailingToAnchor(contentView.trailingAnchor),
-            imageView.constraintAlignTopToAnchor( contentView.topAnchor),
+            imageView.constraintAlignTopToAnchor(contentView.topAnchor),
+            imageView.constraintAlignBottomToAnchor(contentView.bottomAnchor),
             descriptionLabel.constraintAlignLeadingTo(imageView),
-            descriptionLabel.constraintToBottomOf(imageView),
-            descriptionLabel.constraintAlignTrailingTo(imageView),
-            descriptionLabel.constraintAlignBottomToAnchor(contentView.bottomAnchor),
+            descriptionLabel.constraintAlignTrailingMaxTo(imageView),
+            descriptionLabel.constraintAlignBottomTo(imageView),
         ])
     }