Explorar o código

header no longer upper cased + centerY aligned

nayooti %!s(int64=5) %!d(string=hai) anos
pai
achega
8bdff8703f
Modificáronse 1 ficheiros con 1 adicións e 13 borrados
  1. 1 13
      deltachat-ios/View/GallerySectionHeader.swift

+ 1 - 13
deltachat-ios/View/GallerySectionHeader.swift

@@ -26,8 +26,7 @@ class GalleryGridSectionHeader: UICollectionReusableView {
 
     var text: String? {
         set {
-            label.text = newValue?.uppercased()
-            yAlignLabel(ratio: 0.75)
+            label.text = newValue
         }
         get {
             return label.text
@@ -52,15 +51,4 @@ class GalleryGridSectionHeader: UICollectionReusableView {
         label.leadingAnchor.constraint(equalTo: leadingAnchor, constant: leadingMargin).isActive = true
         label.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -leadingMargin).isActive = true
     }
-
-    /// Can be used to offset the label from center (if there is enough space) - ration == 0.5 will Ycenter the label - ratio >= 0.5 will move the label down.
-    private func yAlignLabel(ratio: CGFloat) {
-        safe_assert(ratio <= 1)
-        let labelHeight = label.intrinsicContentSize.height
-        let verticalMarginTotal = frame.height - labelHeight
-        if verticalMarginTotal > 0 {
-            labelBottomConstraint.constant = verticalMarginTotal * (1 - ratio)
-            labelTopConstraint.constant = verticalMarginTotal * ratio
-        }
-    }
 }