     }
 }
 
+class LibraryPanelButton: UIButton {
+    var nameLabel = UILabel()
+
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 5, right: 0)
+        addSubview(nameLabel)
+        nameLabel.snp.makeConstraints { make in
+            make.bottom.equalToSuperview()
+            make.centerX.equalToSuperview()
+            make.width.equalToSuperview()
+        }
+        nameLabel.adjustsFontSizeToFitWidth = true
+        nameLabel.minimumScaleFactor = 0.7
+        nameLabel.numberOfLines = 2
+        nameLabel.font = DynamicFontHelper.defaultHelper.SmallSizeRegularWeightAS
+        nameLabel.textAlignment = .center
+    }
+
+    required init(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+}
+
 // MARK: UIAppearance
 extension HomePanelViewController: Themeable {
     func applyTheme() {


private struct HomePanelViewControllerUX {
    // Height of the top panel switcher button toolbar.
    static let ButtonContainerHeight: CGFloat = 40
}

protocol HomePanel: AnyObject, Themeable {


    fileprivate func updateButtons() {
        for panel in panels {
            let button = LibraryPanelButton()
            button.addTarget(self, action: #selector(tappedButton), for: .touchUpInside)
            if let image = UIImage.templateImageNamed("panelIcon\(panel.imageName)") {
                button.setImage(image, for: .normal)
            }

            button.nameLabel.text = panel.accessibilityLabel
            button.accessibilityLabel = panel.accessibilityLabel
            button.accessibilityIdentifier = panel.accessibilityIdentifier
            buttons.append(button)
