0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

feat(themes): moved themes to bec_qthemes

This commit is contained in:
2024-07-22 21:30:33 +02:00
parent 067496b18c
commit 3798714369
3 changed files with 5 additions and 6 deletions

View File

@ -2,11 +2,10 @@ 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
@ -14,7 +13,7 @@ CURRENT_THEME = "dark"
def get_theme_palette():
return DarkPalette if CURRENT_THEME == "dark" else LightPalette
return bec_qthemes.load_palette(CURRENT_THEME)
def apply_theme(theme: Literal["dark", "light"]):
@ -30,7 +29,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 = qdarkstyle.load_stylesheet(palette=get_theme_palette())
style = bec_qthemes.load_stylesheet(theme)
app.setStyleSheet(style)

View File

@ -55,7 +55,7 @@ class SpinnerWidget(QWidget):
color_palette = get_theme_palette()
color = QColor(color_palette.COLOR_ACCENT_4)
color = QColor(color_palette.accent())
rect.adjust(line_width, line_width, -line_width, -line_width)

View File

@ -19,7 +19,7 @@ dependencies = [
"isort~=5.13, >=5.13.2", # needed for bw-generate-cli
"pydantic~=2.0",
"pyqtgraph~=0.13",
"qdarkstyle>=3.2.2",
"bec_qthemes~=0.0",
"qtconsole~=5.5, >=5.5.1", # needed for jupyter console
"qtpy~=2.4",
"pyte", # needed for vt100 console