v0.77.1: a cassetted song shows a little blue down-arrow instead of going grey

Asked for and waiting to download now reads as that: the button stays
pressed in, in its own face, with the tape nudged up-left and a blue
arrow in the corner (paler for a partly asked-for artist or album, faded
on hover to say a click lets it go). The guide's icons and friend-mode
screenshot are repainted with the same code.
This commit is contained in:
2026-10-23 01:13:20 -07:00
parent 5f41460cb6
commit 3a3d518092
7 changed files with 51 additions and 21 deletions
+2 -2
View File
@@ -90,8 +90,8 @@ your computer yet). Instead, every artist, album and song has a little
| Button | What it means | | Button | What it means |
|---|---| |---|---|
| <img src="docs/cassette/cassette-off.png" width="28" alt="cassette button, not pressed"> | Not asked for. Click it to ask your friend for this. | | <img src="docs/cassette/cassette-off.png" width="28" alt="cassette button, not pressed"> | Not asked for. Click it to ask your friend for this. |
| <img src="docs/cassette/cassette-on.png" width="28" alt="cassette button, pressed"> | Asked for — this song is on its way to you. Click again to change your mind. | | <img src="docs/cassette/cassette-on.png" width="28" alt="cassette button, pressed, with a blue down-arrow"> | Asked for — the blue arrow means this song is waiting to download to you. Click again to change your mind. |
| <img src="docs/cassette/cassette-partial.png" width="28" alt="cassette button, partly pressed"> | Some of this artist's or album's songs are asked for. Click to ask for all of them. | | <img src="docs/cassette/cassette-partial.png" width="28" alt="cassette button, pressed, with a pale blue down-arrow"> | Some of this artist's or album's songs are asked for. Click to ask for all of them. |
Pressing the button on an **artist** or **album** asks for every song under it. Pressing the button on an **artist** or **album** asks for every song under it.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 158 KiB

+1 -1
View File
@@ -1,3 +1,3 @@
"""LinTunes — iTunes-style music library manager and player for Linux.""" """LinTunes — iTunes-style music library manager and player for Linux."""
__version__ = "0.77.0" __version__ = "0.77.1"
+48 -18
View File
@@ -1,9 +1,11 @@
"""Cassette's two little pictures, painted (no image files to ship or theme). """Cassette's two little pictures, painted (no image files to ship or theme).
* The **cassette button**: a small embossed square with a tape glyph. Raised * The **cassette button**: a small embossed square with a tape glyph. Raised
when off; pressed in and grey when on ("I want this"); a medium grey on when off; pressed in with a little blue down-arrow when on ("asked for,
hover over a pressed one, to say a click would let it go. Functionally on its way"); the arrow fades on hover over a pressed one, to say a click
it's a checkbox — the tape is reserved for asking friends for songs. would let it go. Partly asked for (an artist or album) is a paler
arrow. Functionally it's a checkbox — the tape is reserved for asking
friends for songs.
* The **UFO**: a friend's playlist. Light purple when followed, a grey * The **UFO**: a friend's playlist. Light purple when followed, a grey
outline when not. outline when not.
@@ -24,8 +26,7 @@ UFO_PURPLE = QColor("#b38ee8")
OFF, ON, PARTIAL = "off", "on", "partial" OFF, ON, PARTIAL = "off", "on", "partial"
ON_GREY = QColor("#9c9c9c") ASKED_BLUE = QColor("#2f7de1") # the "on its way" arrow
ON_HOVER_GREY = QColor("#bdbdbd")
def friend_button_qss(selector: str = "QPushButton", padding: str = "3px 12px") -> str: def friend_button_qss(selector: str = "QPushButton", padding: str = "3px 12px") -> str:
@@ -58,24 +59,56 @@ def paint_cassette_button(painter: QPainter, rect: QRectF, state: str,
gradient.setColorAt(0, top) gradient.setColorAt(0, top)
gradient.setColorAt(1, base.darker(106)) gradient.setColorAt(1, base.darker(106))
else: else:
fill = ON_HOVER_GREY if hovered else ON_GREY gradient.setColorAt(0, base.darker(118)) # pressed in: lit from below
if state == PARTIAL: gradient.setColorAt(1, base.darker(104))
fill = QColor(fill).lighter(118)
gradient.setColorAt(0, fill.darker(108)) # pressed in: lit from below
gradient.setColorAt(1, fill.lighter(106))
painter.setBrush(QBrush(gradient)) painter.setBrush(QBrush(gradient))
painter.setPen(QPen(mid, 1)) painter.setPen(QPen(mid, 1))
painter.drawRoundedRect(box, radius, radius) painter.drawRoundedRect(box, radius, radius)
ink = QColor(palette.text().color()) ink = QColor(palette.text().color())
if state != OFF: ink.setAlpha(150)
ink = QColor("#303030") if state == OFF:
ink.setAlpha(200 if state != OFF else 150) _paint_tape(painter, box, ink)
_paint_tape(painter, box, ink, half=(state == PARTIAL)) else:
# the tape moves up and left to make room for the arrow
_paint_tape(painter, box.translated(-box.width() * 0.06,
-box.height() * 0.08), ink)
blue = QColor(ASKED_BLUE)
blue.setAlpha((255 if state == ON else 130) // (2 if hovered else 1))
_paint_arrow(painter, box, blue, base.darker(110))
painter.restore() painter.restore()
def _paint_tape(painter: QPainter, box: QRectF, ink: QColor, half=False): def _paint_arrow(painter: QPainter, box: QRectF, color: QColor,
halo: QColor):
"""A down-arrow in the bottom-right corner, ringed in the button's own
face so it stands off the tape behind it."""
w, h = box.width(), box.height()
cx = box.left() + w * 0.75
top, bottom = box.top() + h * 0.5, box.top() + h * 0.88
shaft, head = w * 0.08, w * 0.17
neck = bottom - h * 0.17
path = QPainterPath()
path.moveTo(cx - shaft, top)
path.lineTo(cx + shaft, top)
path.lineTo(cx + shaft, neck)
path.lineTo(cx + head, neck)
path.lineTo(cx, bottom)
path.lineTo(cx - head, neck)
path.lineTo(cx - shaft, neck)
path.closeSubpath()
line = max(1.0, w / 16)
painter.setBrush(Qt.BrushStyle.NoBrush)
painter.setPen(QPen(halo, line * 3, Qt.PenStyle.SolidLine,
Qt.PenCapStyle.RoundCap, Qt.PenJoinStyle.RoundJoin))
painter.drawPath(path)
painter.setPen(QPen(color, line, Qt.PenStyle.SolidLine,
Qt.PenCapStyle.RoundCap, Qt.PenJoinStyle.RoundJoin))
painter.setBrush(color)
painter.drawPath(path)
def _paint_tape(painter: QPainter, box: QRectF, ink: QColor):
"""A cassette: body, label window, two reels.""" """A cassette: body, label window, two reels."""
w, h = box.width(), box.height() w, h = box.width(), box.height()
body = QRectF(box.left() + w * 0.16, box.top() + h * 0.28, body = QRectF(box.left() + w * 0.16, box.top() + h * 0.28,
@@ -96,9 +129,6 @@ def _paint_tape(painter: QPainter, box: QRectF, ink: QColor, half=False):
path.lineTo(body.left() + body.width() * 0.7, body.bottom() - body.height() * 0.22) path.lineTo(body.left() + body.width() * 0.7, body.bottom() - body.height() * 0.22)
path.lineTo(body.left() + body.width() * 0.78, body.bottom()) path.lineTo(body.left() + body.width() * 0.78, body.bottom())
painter.drawPath(path) painter.drawPath(path)
if half:
painter.drawLine(QPointF(body.left() + body.width() * 0.4, cy),
QPointF(body.left() + body.width() * 0.6, cy))
def paint_ufo(painter: QPainter, rect: QRectF, color: QColor, def paint_ufo(painter: QPainter, rect: QRectF, color: QColor,