From fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6 Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Mon, 22 Jul 2024 21:35:07 +0200 Subject: [PATCH] Revert "feat(themes): moved themes to bec_qthemes" This reverts commit 3798714369adf4023f833b7749d2f46a0ec74eee --- bec_widgets/utils/colors.py | 7 ++++--- bec_widgets/widgets/spinner/spinner.py | 2 +- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bec_widgets/utils/colors.py b/bec_widgets/utils/colors.py index c6d9a379..7642a82a 100644 --- a/bec_widgets/utils/colors.py +++ b/bec_widgets/utils/colors.py @@ -2,10 +2,11 @@ import itertools import re from typing import Literal -import bec_qthemes import numpy as np import pyqtgraph as pg +import qdarkstyle from pydantic_core import PydanticCustomError +from qdarkstyle import DarkPalette, LightPalette from qtpy.QtGui import QColor from qtpy.QtWidgets import QApplication @@ -13,7 +14,7 @@ CURRENT_THEME = "dark" def get_theme_palette(): - return bec_qthemes.load_palette(CURRENT_THEME) + return DarkPalette if CURRENT_THEME == "dark" else LightPalette def apply_theme(theme: Literal["dark", "light"]): @@ -29,7 +30,7 @@ def apply_theme(theme: Literal["dark", "light"]): pg_widget.setBackground("k" if theme == "dark" else "w") # now define stylesheet according to theme and apply it - style = bec_qthemes.load_stylesheet(theme) + style = qdarkstyle.load_stylesheet(palette=get_theme_palette()) app.setStyleSheet(style) diff --git a/bec_widgets/widgets/spinner/spinner.py b/bec_widgets/widgets/spinner/spinner.py index 495fbb18..2231e73f 100644 --- a/bec_widgets/widgets/spinner/spinner.py +++ b/bec_widgets/widgets/spinner/spinner.py @@ -55,7 +55,7 @@ class SpinnerWidget(QWidget): color_palette = get_theme_palette() - color = QColor(color_palette.accent()) + color = QColor(color_palette.COLOR_ACCENT_4) rect.adjust(line_width, line_width, -line_width, -line_width) diff --git a/pyproject.toml b/pyproject.toml index c2ced8fa..7a3ef0fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "isort~=5.13, >=5.13.2", # needed for bw-generate-cli "pydantic~=2.0", "pyqtgraph~=0.13", - "bec_qthemes~=0.0", + "qdarkstyle>=3.2.2", "qtconsole~=5.5, >=5.5.1", # needed for jupyter console "qtpy~=2.4", "pyte", # needed for vt100 console