diff --git a/bec_widgets/widgets/services/bec_queue/bec_queue.py b/bec_widgets/widgets/services/bec_queue/bec_queue.py index a890fbc0..8a213e9c 100644 --- a/bec_widgets/widgets/services/bec_queue/bec_queue.py +++ b/bec_widgets/widgets/services/bec_queue/bec_queue.py @@ -13,7 +13,7 @@ from bec_widgets.utils.bec_connector import ConnectionConfig from bec_widgets.utils.bec_widget import BECWidget from bec_widgets.utils.compact_popup import CompactPopupWidget from bec_widgets.utils.error_popups import SafeSlot -from bec_widgets.widgets.services.bec_queue.qml_host import create_quick_widget +from bec_widgets.utils.quick import create_quick_widget from bec_widgets.widgets.services.bec_queue.queue_model import IDLE_STATUSES, QueueController logger = bec_logger.logger @@ -79,7 +79,7 @@ class BECQueue(BECWidget, CompactPopupWidget): def _create_view(self) -> QWidget: """Create the widget that renders the queue: here the QML view.""" - return create_quick_widget(self, QML_FILE, {"queue": self.controller}) + return create_quick_widget(self, QML_FILE, context={"queue": self.controller}) def _release_view(self): """Unload the QML tree before the controller it binds to is deleted.""" diff --git a/bec_widgets/widgets/services/bec_queue/qml/BECQueue.qml b/bec_widgets/widgets/services/bec_queue/qml/BECQueue.qml index d08cc5a6..3956b8cc 100644 --- a/bec_widgets/widgets/services/bec_queue/qml/BECQueue.qml +++ b/bec_widgets/widgets/services/bec_queue/qml/BECQueue.qml @@ -166,7 +166,7 @@ Rectangle { contentItem: Text { leftPadding: mi.checkable ? 22 : 4 text: mi.text - color: !mi.enabled ? theme.faint : mi.text.indexOf("Halt") === 0 || mi.text.indexOf("Clear") === 0 ? theme.errText : theme.fg + color: !mi.enabled ? theme.faint : mi.text.indexOf("Halt") === 0 || mi.text.indexOf("Clear") === 0 ? theme.dangerText : theme.fg font.pixelSize: 13 verticalAlignment: Text.AlignVCenter } @@ -212,7 +212,7 @@ Rectangle { Layout.bottomMargin: 8 implicitHeight: bannerRow.implicitHeight + 16 radius: 7 - color: root.locked ? theme.errTint : theme.warnTint + color: root.locked ? theme.dangerTint : theme.warningTint RowLayout { id: bannerRow anchors { fill: parent; margins: 8; leftMargin: 10 } @@ -220,7 +220,7 @@ Rectangle { Icon { name: root.locked ? "lock" : "pause_circle" size: 20 - color: root.locked ? theme.errText : theme.warnText + color: root.locked ? theme.dangerText : theme.warningText Layout.alignment: Qt.AlignTop } ColumnLayout { diff --git a/bec_widgets/widgets/services/bec_queue/qml/IconButton.qml b/bec_widgets/widgets/services/bec_queue/qml/IconButton.qml index 216e8533..5bd341d8 100644 --- a/bec_widgets/widgets/services/bec_queue/qml/IconButton.qml +++ b/bec_widgets/widgets/services/bec_queue/qml/IconButton.qml @@ -31,7 +31,7 @@ AbstractButton { anchors.centerIn: parent name: root.iconName size: root.iconSize - color: !root.enabled ? theme.faint : root.danger ? theme.errText : theme.muted + color: !root.enabled ? theme.faint : root.danger ? theme.dangerText : theme.muted } } } diff --git a/bec_widgets/widgets/services/bec_queue/qml/QueueRow.qml b/bec_widgets/widgets/services/bec_queue/qml/QueueRow.qml index 2688bf20..f78e45f7 100644 --- a/bec_widgets/widgets/services/bec_queue/qml/QueueRow.qml +++ b/bec_widgets/widgets/services/bec_queue/qml/QueueRow.qml @@ -137,7 +137,7 @@ Rectangle { height: parent.height radius: 2.5 width: parent.width * Math.max(0, row.progress) - color: row.tone === "warn" ? theme.warn : theme.busy + color: row.tone === "warn" ? theme.warning : theme.busy Behavior on width { NumberAnimation { duration: 250; easing.type: Easing.OutCubic } } } Rectangle { // indeterminate: no progress reported yet diff --git a/bec_widgets/widgets/services/bec_queue/qml/StatusPill.qml b/bec_widgets/widgets/services/bec_queue/qml/StatusPill.qml index afd21951..1f05862c 100644 --- a/bec_widgets/widgets/services/bec_queue/qml/StatusPill.qml +++ b/bec_widgets/widgets/services/bec_queue/qml/StatusPill.qml @@ -9,14 +9,14 @@ Rectangle { property string iconName property string tone: "neutral" - readonly property color textColor: tone === "busy" ? theme.busyText - : tone === "ok" ? theme.okText - : tone === "warn" ? theme.warnText - : tone === "err" ? theme.errText + readonly property color textColor: tone === "busy" ? theme.infoText + : tone === "ok" ? theme.successText + : tone === "warn" ? theme.warningText + : tone === "err" ? theme.dangerText : tone === "stale" ? theme.faint : theme.muted - readonly property color fillColor: tone === "busy" ? theme.busyTint - : tone === "warn" ? theme.warnTint - : tone === "err" ? theme.errTint : "transparent" + readonly property color fillColor: tone === "busy" ? theme.infoTint + : tone === "warn" ? theme.warningTint + : tone === "err" ? theme.dangerTint : "transparent" implicitHeight: 22 implicitWidth: row.implicitWidth + 14 diff --git a/bec_widgets/widgets/services/bec_queue/qml/TextButton.qml b/bec_widgets/widgets/services/bec_queue/qml/TextButton.qml index 308e718d..769dea08 100644 --- a/bec_widgets/widgets/services/bec_queue/qml/TextButton.qml +++ b/bec_widgets/widgets/services/bec_queue/qml/TextButton.qml @@ -23,16 +23,16 @@ Button { readonly property color fgColor: !enabled ? theme.faint : kind === "dangerSolid" ? "white" - : kind === "danger" ? theme.errText : theme.fg + : kind === "danger" ? theme.dangerText : theme.fg background: Rectangle { radius: 6 color: root.kind === "dangerSolid" - ? (root.down ? Qt.darker(theme.err, 1.2) : root.hovered ? Qt.lighter(theme.err, 1.1) : theme.err) + ? (root.down ? Qt.darker(theme.danger, 1.2) : root.hovered ? Qt.lighter(theme.danger, 1.1) : theme.danger) : root.down ? theme.pressed : root.hovered ? theme.hover : "transparent" border.width: root.visualFocus ? 2 : 1 border.color: root.visualFocus ? theme.primary - : root.kind === "danger" && root.enabled ? Qt.alpha(theme.err, 0.55) + : root.kind === "danger" && root.enabled ? Qt.alpha(theme.danger, 0.55) : root.kind === "dangerSolid" ? "transparent" : theme.border Behavior on color { ColorAnimation { duration: 90 } } } diff --git a/bec_widgets/widgets/services/bec_status_box/bec_status_box.py b/bec_widgets/widgets/services/bec_status_box/bec_status_box.py index ae8734de..5f1cb5c8 100644 --- a/bec_widgets/widgets/services/bec_status_box/bec_status_box.py +++ b/bec_widgets/widgets/services/bec_status_box/bec_status_box.py @@ -134,9 +134,11 @@ class BECStatusBox(BECWidget, CompactPopupWidget): if self.view_kind == "qml": try: # pylint: disable=import-outside-toplevel - from bec_widgets.utils.qml_host import create_quick_widget + from bec_widgets.utils.quick import create_quick_widget - quick = create_quick_widget(self, QML_FILE, context={"statusModel": self.model}) + quick = create_quick_widget( + self, QML_FILE, context={"statusModel": self.model}, raise_on_error=True + ) quick.setMinimumSize(280, 220) return quick except Exception as exc: # pylint: disable=broad-except diff --git a/bec_widgets/widgets/services/bec_status_box/qml/StatusBox.qml b/bec_widgets/widgets/services/bec_status_box/qml/StatusBox.qml index 2c99419d..a25ad90e 100644 --- a/bec_widgets/widgets/services/bec_status_box/qml/StatusBox.qml +++ b/bec_widgets/widgets/services/bec_status_box/qml/StatusBox.qml @@ -15,7 +15,7 @@ Rectangle { function toneColor(tone) { if (tone === "success") return theme.success if (tone === "warning") return theme.warning - if (tone === "emergency") return theme.emergency + if (tone === "emergency") return theme.danger return theme.muted } function iconUrl(name, color, filled) { diff --git a/tests/unit_tests/test_bec_status_box.py b/tests/unit_tests/test_bec_status_box.py index e6e8cd9e..e5c319e7 100644 --- a/tests/unit_tests/test_bec_status_box.py +++ b/tests/unit_tests/test_bec_status_box.py @@ -214,7 +214,7 @@ def test_qml_view_loads(qtbot, mocked_client): def test_qml_falls_back_to_widgets(qtbot, mocked_client): with mock.patch( - "bec_widgets.utils.qml_host.create_quick_widget", side_effect=RuntimeError("no GL") + "bec_widgets.utils.quick.create_quick_widget", side_effect=RuntimeError("no GL") ): box = create_widget( qtbot,