fix(busy-loader): adjust busy loader and tests

This commit is contained in:
2026-01-16 16:38:12 +01:00
committed by wyzula-jan
parent 332ca205c1
commit 94faaba24d
5 changed files with 93 additions and 65 deletions
+19
View File
@@ -1,3 +1,4 @@
import numpy as np
import pytest
from qtpy.QtWidgets import QLabel, QVBoxLayout, QWidget
@@ -68,6 +69,24 @@ def test_becwidget_set_busy_toggle_and_text(qtbot, widget_idle):
qtbot.waitUntil(lambda: overlay.isHidden())
def test_becwidget_busy_overlay_set_opacity(qtbot, widget_busy):
overlay = getattr(widget_busy, "_busy_overlay")
qtbot.waitUntil(lambda: overlay.isVisible())
# Default opacity is 0.7
frame = getattr(overlay, "_frame", None)
assert frame is not None
sheet = frame.styleSheet()
_, _, _, a = overlay.scrim_color.getRgb()
assert np.isclose(a / 255, 0.35, atol=0.02)
# Change opacity
overlay.set_opacity(0.7)
qtbot.waitUntil(lambda: overlay.isVisible())
_, _, _, a = overlay.scrim_color.getRgb()
assert np.isclose(a / 255, 0.7, atol=0.02)
def test_becwidget_overlay_tracks_resize(qtbot, widget_busy):
overlay = getattr(widget_busy, "_busy_overlay")
qtbot.waitUntil(lambda: overlay.geometry() == widget_busy.rect())