v0.51.1: album art sits under the list frame's closing line, like the empty panel

This commit is contained in:
2026-10-13 10:11:55 -07:00
parent 976d338574
commit f48165080b
4 changed files with 58 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
"""Round 82: the list frame closes above album art too."""
from PyQt6.QtGui import QColor, QPixmap
from tests.test_round80 import _sidebar
def test_art_draws_the_frames_closing_line(qapp, tmp_path):
"""A white cover inside the list's frame starts under a line in the
frame's own color, not straight on from the list."""
from lintunes.gui.sidebar import ART_RULE
window, sidebar = _sidebar(qapp, tmp_path)
art = sidebar.art
pixmap = QPixmap(10, 10)
pixmap.fill(QColor("white"))
art._pixmap = pixmap
art.has_art_changed.emit(True)
art._fit_height()
qapp.processEvents()
group = sidebar.list_area.grab().toImage()
# the frame's own left edge, halfway down the list
frame = group.pixelColor(0, group.height() // 4)
image = art.grab().toImage()
middle = image.width() // 2
for y in range(ART_RULE):
assert image.pixelColor(middle, y) == frame
assert image.pixelColor(middle, ART_RULE) == QColor("white")
window.close()