@@ -12,7 +12,7 @@ import SiteImageView
12
12
class ExperimentTabCell : UICollectionViewCell , ThemeApplicable , ReusableCell , FeatureFlaggable {
13
13
struct UX {
14
14
static let selectedBorderWidth : CGFloat = 3.0
15
- static let unselectedBorderWidth : CGFloat = 0.8
15
+ static let unselectedBorderWidth : CGFloat = 1
16
16
static let cornerRadius : CGFloat = 16
17
17
static let subviewDefaultPadding : CGFloat = 6.0
18
18
static let faviconSize = CGSize ( width: 16 , height: 16 )
@@ -26,6 +26,9 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
26
26
static let closeButtonTop : CGFloat = 6
27
27
static let closeButtonTrailing : CGFloat = 8
28
28
static let tabViewFooterSpacing : CGFloat = 4
29
+ static let shadowRadius : CGFloat = 4
30
+ static let shadowOffset = CGSize ( width: 0 , height: 2 )
31
+ static let shadowOpacity : Float = 1
29
32
}
30
33
// MARK: - Properties
31
34
@@ -88,6 +91,12 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
88
91
super. layoutSubviews ( )
89
92
favicon. layer. cornerRadius = UX . faviconSize. height / 2
90
93
smallFaviconView. layer. cornerRadius = UX . fallbackFaviconSize. height / 2
94
+
95
+ backgroundHolder. layoutIfNeeded ( )
96
+ contentView. layer. shadowPath = UIBezierPath (
97
+ roundedRect: self . backgroundHolder. bounds,
98
+ cornerRadius: self . backgroundHolder. layer. cornerRadius
99
+ ) . cgPath
91
100
}
92
101
93
102
// MARK: - Initializer
@@ -171,6 +180,14 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
171
180
screenshotView. backgroundColor = theme. colors. layer1
172
181
favicon. tintColor = theme. colors. textPrimary
173
182
smallFaviconView. tintColor = theme. colors. textPrimary
183
+ setupShadow ( theme: theme)
184
+ }
185
+
186
+ func setupShadow( theme: Theme ) {
187
+ contentView. layer. shadowRadius = UX . shadowRadius
188
+ contentView. layer. shadowOffset = UX . shadowOffset
189
+ contentView. layer. shadowColor = theme. colors. shadowDefault. cgColor
190
+ contentView. layer. shadowOpacity = UX . shadowOpacity
174
191
}
175
192
176
193
// MARK: - Configuration
@@ -232,8 +249,6 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
232
249
// Reset any close animations.
233
250
super. prepareForReuse ( )
234
251
screenshotView. image = nil
235
- backgroundHolder. transform = . identity
236
- backgroundHolder. alpha = 1
237
252
smallFaviconView. isHidden = true
238
253
layer. shadowOffset = . zero
239
254
layer. shadowPath = nil
0 commit comments