mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix: spinner: update reference image for widget test, use apply_theme
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
import qdarktheme
|
||||
from qtpy.QtCore import QRect, Qt, QTimer
|
||||
from qtpy.QtGui import QColor, QPainter, QPen
|
||||
from qtpy.QtWidgets import QApplication, QMainWindow, QWidget
|
||||
|
||||
from bec_widgets.utils.colors import get_theme_palette
|
||||
|
||||
|
||||
def ease_in_out_sine(t):
|
||||
return 1 - np.sin(np.pi * t)
|
||||
@ -52,9 +53,9 @@ class SpinnerWidget(QWidget):
|
||||
background_color = QColor(200, 200, 200, 50)
|
||||
line_width = 5
|
||||
|
||||
color_palette = qdarktheme.load_palette()
|
||||
color_palette = get_theme_palette()
|
||||
|
||||
color = QColor(color_palette.accent().color())
|
||||
color = QColor(color_palette.COLOR_ACCENT_4)
|
||||
|
||||
rect.adjust(line_width, line_width, -line_width, -line_width)
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 14 KiB |
@ -1,13 +1,13 @@
|
||||
import pytest
|
||||
import qdarktheme
|
||||
|
||||
from bec_widgets.utils.colors import apply_theme
|
||||
from bec_widgets.utils.reference_utils import snap_and_compare
|
||||
from bec_widgets.widgets.spinner.spinner import SpinnerWidget
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spinner_widget(qtbot):
|
||||
qdarktheme.setup_theme("light")
|
||||
apply_theme("light")
|
||||
spinner = SpinnerWidget()
|
||||
qtbot.addWidget(spinner)
|
||||
qtbot.waitExposed(spinner)
|
||||
|
Reference in New Issue
Block a user