From 1fbaa517a20205705ded74b9f1f062271e96bc23 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Wed, 26 Nov 2025 15:06:16 +0100 Subject: [PATCH] fix(collapsible_tree_section): update title button styling to use property variant "title"; closes #951 --- .../explorer/collapsible_tree_section.py | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/bec_widgets/widgets/containers/explorer/collapsible_tree_section.py b/bec_widgets/widgets/containers/explorer/collapsible_tree_section.py index f062e3d8..ca15a3ce 100644 --- a/bec_widgets/widgets/containers/explorer/collapsible_tree_section.py +++ b/bec_widgets/widgets/containers/explorer/collapsible_tree_section.py @@ -5,7 +5,6 @@ from qtpy.QtCore import QMimeData, Qt, Signal from qtpy.QtGui import QDrag from qtpy.QtWidgets import QHBoxLayout, QPushButton, QSizePolicy, QToolButton, QVBoxLayout, QWidget -from bec_widgets.utils.colors import get_theme_palette from bec_widgets.utils.error_popups import SafeProperty @@ -49,6 +48,8 @@ class CollapsibleSection(QWidget): # Create header button self.header_button = QPushButton() + # Apply theme variant for title styling + self.header_button.setProperty("variant", "title") self.header_button.clicked.connect(self.toggle_expanded) # Enable drag and drop for reordering @@ -105,23 +106,6 @@ class CollapsibleSection(QWidget): self.header_button.setIcon(icon) self.header_button.setText(self.title) - # Get theme colors - palette = get_theme_palette() - - self.header_button.setStyleSheet( - """ - QPushButton { - font-weight: bold; - text-align: left; - margin: 0; - padding: 0px; - border: none; - background: transparent; - icon-size: 20px 20px; - } - """ - ) - def toggle_expanded(self): """Toggle the expanded state and update size policy""" self.expanded = not self.expanded