diff --git a/woman/qt.py b/woman/qt.py index 0e63b298f587fb3930674c1c97f42b1556e5804b..cf301b6dd61cefdf4b6114536b5216f26630215e 100755 --- a/woman/qt.py +++ b/woman/qt.py @@ -399,7 +399,7 @@ def qt_main(): def __init__(self, t, workspace_widget, is_root, parent=None): super().__init__(t, workspace_widget, is_root, parent) self._hlay = no_space(QHBoxLayout(self)) - self._head = QLabel(self) + self._head = QLabelOpeningBracket(self) self._list = no_space(QVBoxLayout()) self.setAutoFillBackground(True) diff --git a/woman/qt_util.py b/woman/qt_util.py index b0a018b25a9273cf246e43e639ce5cc25d4324fd..895eff932e8ca009e6ec875103404c1794468600 100644 --- a/woman/qt_util.py +++ b/woman/qt_util.py @@ -339,3 +339,20 @@ def key_to_str(key, mod): if mod & Qt.ShiftModifier != 0: c.upper() return c + +class QLabelOpeningBracket(QLabel): + @qtoverride + def paintEvent(self, event): + super().paintEvent(event) + painter = QPainter(self) + + x = self.width() + y = self.height() + line_x = x//3 + text_h = 12 + padding = 3 + if y > text_h + 2*padding: + painter.drawLine(line_x, padding, x-2, padding) + painter.drawLine(line_x, padding, line_x, y//2-text_h//2) + painter.drawLine(line_x, y-1-padding, line_x, y//2+text_h//2) + painter.drawLine(line_x, y-1-padding, x-2, y-1-padding)