@@ -23,15 +23,6 @@ class SearchLanguageButton: UnderlineButton {
2323
2424 // MARK: - UI Elements
2525
26- private lazy var backgroundView : UIView = {
27- let view = UIView ( )
28- view. translatesAutoresizingMaskIntoConstraints = false
29- view. isUserInteractionEnabled = false
30- view. layer. cornerRadius = 8
31- view. layer. masksToBounds = true
32- return view
33- } ( )
34-
3526 private lazy var languageCodeContainer : UIView = {
3627 let view = UIView ( )
3728 view. translatesAutoresizingMaskIntoConstraints = false
@@ -75,7 +66,6 @@ class SearchLanguageButton: UnderlineButton {
7566 titleLabel. numberOfLines = 1
7667 titleLabel. adjustsFontForContentSizeCategory = true
7768
78- insertSubview ( backgroundView, belowSubview: titleLabel)
7969 addSubview ( languageCodeContainer)
8070 languageCodeContainer. addSubview ( languageCodeLabel)
8171
@@ -90,11 +80,7 @@ class SearchLanguageButton: UnderlineButton {
9080 languageCodeLabel. centerYAnchor. constraint ( equalTo: languageCodeContainer. centerYAnchor) ,
9181 languageCodeLabel. centerXAnchor. constraint ( equalTo: languageCodeContainer. centerXAnchor) ,
9282 languageCodeLabel. leadingAnchor. constraint ( equalTo: languageCodeContainer. leadingAnchor, constant: 2 ) ,
93- languageCodeLabel. trailingAnchor. constraint ( equalTo: languageCodeContainer. trailingAnchor, constant: - 2 ) ,
94- backgroundView. leadingAnchor. constraint ( equalTo: leadingAnchor) ,
95- backgroundView. trailingAnchor. constraint ( equalTo: trailingAnchor) ,
96- backgroundView. topAnchor. constraint ( equalTo: topAnchor) ,
97- backgroundView. bottomAnchor. constraint ( equalTo: bottomAnchor)
83+ languageCodeLabel. trailingAnchor. constraint ( equalTo: languageCodeContainer. trailingAnchor, constant: - 2 )
9884 ] )
9985
10086 let isRTL = effectiveUserInterfaceLayoutDirection == . rightToLeft
@@ -117,7 +103,6 @@ class SearchLanguageButton: UnderlineButton {
117103 tintColor = isSelected ? theme. colors. link : theme. colors. tertiaryText
118104 languageCodeContainer. backgroundColor = isSelected ? theme. colors. link : theme. colors. tertiaryText
119105 languageCodeLabel. textColor = theme. colors. paperBackground
120- backgroundView. backgroundColor = theme. colors. paperBackground
121106 }
122107
123108}
0 commit comments