diff --git a/avalon/tools/widgets.py b/avalon/tools/widgets.py index a144de51e..75d7f2598 100644 --- a/avalon/tools/widgets.py +++ b/avalon/tools/widgets.py @@ -442,10 +442,13 @@ def __init__(self, label, parent=None): layout.addWidget(option) body.setMouseTracking(True) + label.setMouseTracking(True) + option.setMouseTracking(True) self.setMouseTracking(True) self.setFixedHeight(32) self.icon = icon + self.label = label self.option = option self.body = body @@ -458,7 +461,7 @@ def setIcon(self, icon): self.icon.setPixmap(pixmap) -class OptionBox(QtWidgets.QWidget): +class OptionBox(QtWidgets.QLabel): """Option box widget class for `OptionalActionWidget`""" clicked = QtCore.Signal() @@ -466,19 +469,12 @@ class OptionBox(QtWidgets.QWidget): def __init__(self, parent): super(OptionBox, self).__init__(parent) - label = QtWidgets.QLabel() - - layout = QtWidgets.QHBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.addSpacing(8) - layout.addWidget(label) + self.setAlignment(QtCore.Qt.AlignCenter) icon = qtawesome.icon("fa.sticky-note-o", color="#c6c6c6") pixmap = icon.pixmap(18, 18) - label.setPixmap(pixmap) + self.setPixmap(pixmap) - label.setMouseTracking(True) - self.setMouseTracking(True) self.setStyleSheet("background: transparent;") def is_hovered(self, global_pos):