v0.51.1: album art sits under the list frame's closing line, like the empty panel
This commit is contained in:
@@ -138,6 +138,7 @@ def test_no_art_panel_sits_below_the_frame(qapp, tmp_path):
|
||||
|
||||
def test_real_art_goes_inside_the_frame(qapp, tmp_path):
|
||||
from PyQt6.QtGui import QPixmap
|
||||
from lintunes.gui.sidebar import ART_RULE
|
||||
window, sidebar = _sidebar(qapp, tmp_path)
|
||||
art = sidebar.art
|
||||
pixmap = QPixmap(10, 10)
|
||||
@@ -146,7 +147,7 @@ def test_real_art_goes_inside_the_frame(qapp, tmp_path):
|
||||
art.has_art_changed.emit(True)
|
||||
art._fit_height()
|
||||
assert art.parentWidget() is sidebar.list_area
|
||||
assert art.height() == art.width()
|
||||
assert art.height() == art.width() + ART_RULE
|
||||
art._pixmap = None
|
||||
art.set_track(None)
|
||||
assert art.parentWidget() is sidebar
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user