fix: tree items due to pushbutton margins

This commit is contained in:
2025-10-15 14:07:36 +02:00
parent b6f8866667
commit 43d49276ce
@@ -3,6 +3,8 @@ from __future__ import annotations
import json
from typing import TYPE_CHECKING
from qtpy.QtWidgets import QApplication
from bec_lib.logger import bec_logger
from bec_qthemes._icon.material_icons import material_icon
from qtpy.QtGui import QValidator
@@ -97,6 +99,7 @@ class CurveRow(QTreeWidgetItem):
# A top-level device row.
super().__init__(tree)
self.app = QApplication.instance()
self.tree = tree
self.parent_item = parent_item
self.curve_tree = tree.parent() # The CurveTree widget
@@ -194,7 +197,16 @@ class CurveRow(QTreeWidgetItem):
# If device row, add "Add DAP" button
if self.source in ("device", "history"):
self.add_dap_button = QPushButton("DAP")
self.add_dap_button = QToolButton()
analysis_icon = material_icon(
"monitoring",
size=(20, 20),
convert_to_pixmap=False,
filled=False,
color=self.app.theme.colors["FG"].toTuple(),
)
self.add_dap_button.setIcon(analysis_icon)
self.add_dap_button.setToolTip("Add DAP")
self.add_dap_button.clicked.connect(lambda: self.add_dap_row())
actions_layout.addWidget(self.add_dap_button)