mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-12-30 02:31:20 +01:00
test: fixes after theme changes
This commit is contained in:
@@ -83,6 +83,8 @@ class BECWidget(BECConnector):
|
||||
if hasattr(qapp, "theme"):
|
||||
qapp.theme.theme_changed.connect(self._update_theme)
|
||||
|
||||
@SafeSlot(str)
|
||||
@SafeSlot()
|
||||
def _update_theme(self, theme: str | None = None):
|
||||
"""Update the theme."""
|
||||
if theme is None:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -17,10 +17,6 @@ def abort_button(qtbot, mocked_client):
|
||||
|
||||
def test_abort_button(abort_button):
|
||||
assert abort_button.button.text() == "Abort"
|
||||
assert (
|
||||
abort_button.button.styleSheet()
|
||||
== "background-color: #666666; color: white; font-weight: bold; font-size: 12px;"
|
||||
)
|
||||
abort_button.button.click()
|
||||
assert abort_button.queue.request_scan_abortion.called
|
||||
abort_button.close()
|
||||
|
||||
@@ -71,16 +71,3 @@ def test_dark_mode_button_changes_theme(dark_mode_button):
|
||||
|
||||
dark_mode_button.toggle_dark_mode()
|
||||
mocked_set_theme.assert_called_with("light")
|
||||
|
||||
|
||||
def test_dark_mode_button_changes_on_os_theme_change(qtbot, dark_mode_button):
|
||||
"""
|
||||
Test that the dark mode button changes the theme correctly when the OS theme changes.
|
||||
"""
|
||||
qapp = QApplication.instance()
|
||||
assert dark_mode_button.dark_mode_enabled is False
|
||||
assert dark_mode_button.mode_button.toolTip() == "Set Dark Mode"
|
||||
qapp.theme_signal.theme_updated.emit("dark")
|
||||
qtbot.wait(100)
|
||||
assert dark_mode_button.dark_mode_enabled is True
|
||||
assert dark_mode_button.mode_button.toolTip() == "Set Light Mode"
|
||||
|
||||
Reference in New Issue
Block a user