diff --git a/Sources/Mistica/Components/Lists/ListCellContentView.swift b/Sources/Mistica/Components/Lists/ListCellContentView.swift index 97d7fdcd8..6ad04d5c5 100644 --- a/Sources/Mistica/Components/Lists/ListCellContentView.swift +++ b/Sources/Mistica/Components/Lists/ListCellContentView.swift @@ -48,6 +48,14 @@ open class ListCellContentView: UIView { // MARK: Public + public var titleLabel: UILabel { + centerSection.titleLabel + } + + public var subtitleLabel: UILabel { + centerSection.subtitleLabel + } + public var title: String? { get { centerSection.titleLabel.text diff --git a/Sources/Mistica/Components/Popover/PopoverView.swift b/Sources/Mistica/Components/Popover/PopoverView.swift index 830c563ee..2ade0e4ad 100644 --- a/Sources/Mistica/Components/Popover/PopoverView.swift +++ b/Sources/Mistica/Components/Popover/PopoverView.swift @@ -246,14 +246,11 @@ private extension PopoverView { centerX.isActive = true NSLayoutConstraint.activate([ - // Maximum width is container width minus the margin - widthAnchor.constraint(lessThanOrEqualTo: containerView.widthAnchor, constant: -(ViewStyles.leadingMarginToContainerView + ViewStyles.trailingMarginToContainerView)), - heightAnchor.constraint(equalTo: contentView.heightAnchor, constant: ViewStyles.tipSize.height), + // Width is 100% minus 32pt (16pt horizontal padding) + leadingAnchor.constraint(equalTo: containerView.leadingAnchor, constant: ViewStyles.leadingMarginToContainerView), + trailingAnchor.constraint(equalTo: containerView.trailingAnchor, constant: -ViewStyles.trailingMarginToContainerView), contentView.widthAnchor.constraint(equalTo: widthAnchor), - - // Keep the popover respecting the margin with containerView - leadingAnchor.constraint(greaterThanOrEqualTo: containerView.leadingAnchor, constant: ViewStyles.leadingMarginToContainerView), - trailingAnchor.constraint(lessThanOrEqualTo: containerView.trailingAnchor, constant: -ViewStyles.trailingMarginToContainerView) + heightAnchor.constraint(equalTo: contentView.heightAnchor, constant: ViewStyles.tipSize.height) ]) switch tipDirection { diff --git a/Tests/MisticaTests/UI/PopoverViewTests.swift b/Tests/MisticaTests/UI/PopoverViewTests.swift index 15c04ae72..ce8fb0fec 100644 --- a/Tests/MisticaTests/UI/PopoverViewTests.swift +++ b/Tests/MisticaTests/UI/PopoverViewTests.swift @@ -80,7 +80,7 @@ final class PopoverViewTests: XCTestCase { assertSnapshot( matching: popover, - as: .image(size: .init(width: 200, height: 100)) + as: .image(size: .init(width: 500, height: 100)) ) } diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-blau-dark-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-blau-dark-style.png index b72871525..1b1e6e296 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-blau-dark-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-blau-dark-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-blau-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-blau-style.png index 9a1e34b70..a7cee5ee0 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-blau-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-blau-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-movistar-dark-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-movistar-dark-style.png index 2da39964e..ed6cf5686 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-movistar-dark-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-movistar-dark-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-movistar-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-movistar-style.png index f2e97e3c4..ec8d168e4 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-movistar-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-movistar-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-o2-dark-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-o2-dark-style.png index 3ff287cce..c0ded0c6c 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-o2-dark-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-o2-dark-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-o2-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-o2-style.png index 879d8131a..34ce36bbc 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-o2-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-o2-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivo-dark-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivo-dark-style.png index 3ff287cce..c0ded0c6c 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivo-dark-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivo-dark-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivo-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivo-style.png index d3237bdc8..4a3de343b 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivo-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivo-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivoNew-dark-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivoNew-dark-style.png index 3ff287cce..c0ded0c6c 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivoNew-dark-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivoNew-dark-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivoNew-style.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivoNew-style.png index d3237bdc8..4a3de343b 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivoNew-style.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testBrandStyles.with-vivoNew-style.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeSubtitle.1.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeSubtitle.1.png index bb759f494..c169e108d 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeSubtitle.1.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeSubtitle.1.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeTitle.1.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeTitle.1.png index 0e55e5e5f..c4bf4553e 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeTitle.1.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeTitle.1.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeTitleAndSubtitle.1.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeTitleAndSubtitle.1.png index dbd38f42a..f24455c2e 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeTitleAndSubtitle.1.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testLargeTitleAndSubtitle.1.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoClose.1.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoClose.1.png index 3bfc789b0..3deab1ae6 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoClose.1.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoClose.1.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoImage.1.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoImage.1.png index 62ca9a824..250510f54 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoImage.1.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoImage.1.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoSubtitle.1.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoSubtitle.1.png index 4ec245039..ed45249b3 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoSubtitle.1.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoSubtitle.1.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoTitle.1.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoTitle.1.png index 7f03e953f..d14905067 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoTitle.1.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testNoTitle.1.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testTipDirection.1.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testTipDirection.1.png index d3237bdc8..4a3de343b 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testTipDirection.1.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testTipDirection.1.png differ diff --git a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testTipDirection.2.png b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testTipDirection.2.png index 5fd41fc61..380c7d964 100644 Binary files a/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testTipDirection.2.png and b/Tests/MisticaTests/UI/__Snapshots__/PopoverViewTests/testTipDirection.2.png differ