class FontColorButton(QPushButton):
    """ Displays the currently selected color and provides an icon for indicating what is being colored """
    def __init__(self, icon: QIcon, s: str):
        super().__init__()
        self._lo = QHBoxLayout()
        self._filler = QToolBar()
        self._filler.addAction(icon, s)
        self._filler.setMaximumHeight(25)
        self._filler.setMaximumWidth(25)
        self._filler.setStyleSheet("""
            QWidget {
                border: 0px
            }
        """)
        self._filler.actionTriggered.connect(lambda _: self.pressed.emit())
        self._lo.addWidget(self._filler)
        self._lo.setSpacing(0)
        self.setMaximumWidth(40)
        self._color_display = QLabel("")
        self._color_display.setMinimumWidth(8)
        self._lo.addWidget(self._color_display)
        self.setLayout(self._lo)
        self._lo.setMargin(3)

    def set_color_display(self, color: QColor):
        self._color_display.setStyleSheet(
            "border-radius: 2px; background-color: {};".format(color.name()))