v0.31.7: fixed 16px gaps in the top row, panel fills the rest; right inset

The row of boxes keeps one 16px gap before, between and after its
controls at every width; the now-playing panel and the seek row under it
take all the remaining width. The track lists get the same 8px of bare
window on the right that the playlists have on the left. README updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-28 23:45:34 -07:00
co-authored by Claude Opus 5.5
parent 8ffec1be82
commit 925b9521af
5 changed files with 42 additions and 60 deletions
+19 -11
View File
@@ -3,8 +3,8 @@
The Library button, the view's header (search box or playlist name) and the
seek row share one row under the transport boxes: the Library button as wide
as the sidebar, the header where the view starts, the seek row exactly under
the now-playing panel. The panel stops at NOW_PLAYING_MAX and the gaps between
the controls share what's left.
the now-playing panel. The row of boxes keeps one GAP before, between and
after its controls, and the panel fills the rest.
"""
from PyQt6.QtCore import QPoint
@@ -112,18 +112,29 @@ def test_header_row_shares_the_seek_band(qapp, tmp_path):
assert library.mapTo(bar, QPoint()).y() >= row.geometry().top()
def test_panel_scales_with_the_window(qapp, tmp_path):
def test_panel_fills_what_the_gaps_leave(qapp, tmp_path):
window = _window(qapp, tmp_path, width=1920)
bar = window._transport
assert abs(bar._now_playing.width() - 700) <= 1
wide = bar._now_playing.width()
window.resize(1280, 500)
qapp.processEvents()
assert wide - bar._now_playing.width() == 640
window.resize(800, 500)
qapp.processEvents()
assert NOW_PLAYING_MIN <= bar._now_playing.width() < 700
assert bar._now_playing.width() >= NOW_PLAYING_MIN
bpm = bar._bpm_button.parentWidget()
assert bar._now_playing.geometry().right() < bpm.geometry().left()
assert bpm.geometry().right() < bar.width()
def test_lists_have_bare_window_on_both_sides(qapp, tmp_path):
from lintunes.gui.sidebar import SIDEBAR_INSET
window = _window(qapp, tmp_path)
lists, view = window.sidebar.list_area, window._library_view
assert _gx(lists) - _gx(window) == SIDEBAR_INSET
assert _gx(window, window.width()) - _gx(view, view.width()) == SIDEBAR_INSET
def test_views_seek_row_never_overlaps_the_header(qapp, tmp_path):
window = _window(qapp, tmp_path, width=800)
strip = window._library_view.header
@@ -144,7 +155,7 @@ def test_long_name_shrinks_then_elides(qapp):
def test_row_is_knolled_with_equal_gaps_and_ends(qapp, tmp_path):
from lintunes.gui.transport import MIN_GAP
from lintunes.gui.transport import GAP
window = _window(qapp, tmp_path)
bar = window._transport
for width in (900, 1280, 1920):
@@ -155,9 +166,6 @@ def test_row_is_knolled_with_equal_gaps_and_ends(qapp, tmp_path):
bar._bpm_button.parentWidget()]
edges = [(w.geometry().left(), w.geometry().right()) for w in row]
gaps = [b[0] - a[1] - 1 for a, b in zip(edges, edges[1:])]
assert max(gaps) - min(gaps) <= 1
assert gaps[0] >= MIN_GAP
# The ends get the same space as the gaps: the row floats.
# The same GAP everywhere, ends included, at every width.
left_end, right_end = edges[0][0], bar.width() - 1 - edges[-1][1]
for end in (left_end, right_end):
assert abs(end - gaps[0]) <= 7
assert gaps + [left_end, right_end] == [GAP] * 7