diff --git a/cassette.md b/cassette.md index f06d098..d73a300 100644 --- a/cassette.md +++ b/cassette.md @@ -90,8 +90,8 @@ your computer yet). Instead, every artist, album and song has a little | Button | What it means | |---|---| | cassette button, not pressed | Not asked for. Click it to ask your friend for this. | -| cassette button, pressed | Asked for — this song is on its way to you. Click again to change your mind. | -| cassette button, partly pressed | Some of this artist's or album's songs are asked for. Click to ask for all of them. | +| 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. | +| 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. diff --git a/docs/cassette/cassette-on-hover.png b/docs/cassette/cassette-on-hover.png index c3680cb..54df953 100644 Binary files a/docs/cassette/cassette-on-hover.png and b/docs/cassette/cassette-on-hover.png differ diff --git a/docs/cassette/cassette-on.png b/docs/cassette/cassette-on.png index 0116e90..eec8768 100644 Binary files a/docs/cassette/cassette-on.png and b/docs/cassette/cassette-on.png differ diff --git a/docs/cassette/cassette-partial.png b/docs/cassette/cassette-partial.png index dcf993f..a1ab014 100644 Binary files a/docs/cassette/cassette-partial.png and b/docs/cassette/cassette-partial.png differ diff --git a/docs/cassette/friend-mode.png b/docs/cassette/friend-mode.png index 3c27a5d..ff92256 100644 Binary files a/docs/cassette/friend-mode.png and b/docs/cassette/friend-mode.png differ diff --git a/lintunes/__init__.py b/lintunes/__init__.py index 25bdf32..bae84c3 100644 --- a/lintunes/__init__.py +++ b/lintunes/__init__.py @@ -1,3 +1,3 @@ """LinTunes — iTunes-style music library manager and player for Linux.""" -__version__ = "0.77.0" +__version__ = "0.77.1" diff --git a/lintunes/gui/cassette_art.py b/lintunes/gui/cassette_art.py index 3e3cb39..a4e90b4 100644 --- a/lintunes/gui/cassette_art.py +++ b/lintunes/gui/cassette_art.py @@ -1,9 +1,11 @@ """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 - when off; pressed in and grey when on ("I want this"); a medium grey on - hover over a pressed one, to say a click would let it go. Functionally - it's a checkbox — the tape is reserved for asking friends for songs. + when off; pressed in with a little blue down-arrow when on ("asked for, + on its way"); the arrow fades on hover over a pressed one, to say a click + 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 outline when not. @@ -24,8 +26,7 @@ UFO_PURPLE = QColor("#b38ee8") OFF, ON, PARTIAL = "off", "on", "partial" -ON_GREY = QColor("#9c9c9c") -ON_HOVER_GREY = QColor("#bdbdbd") +ASKED_BLUE = QColor("#2f7de1") # the "on its way" arrow 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(1, base.darker(106)) else: - fill = ON_HOVER_GREY if hovered else ON_GREY - if state == PARTIAL: - fill = QColor(fill).lighter(118) - gradient.setColorAt(0, fill.darker(108)) # pressed in: lit from below - gradient.setColorAt(1, fill.lighter(106)) + gradient.setColorAt(0, base.darker(118)) # pressed in: lit from below + gradient.setColorAt(1, base.darker(104)) painter.setBrush(QBrush(gradient)) painter.setPen(QPen(mid, 1)) painter.drawRoundedRect(box, radius, radius) ink = QColor(palette.text().color()) - if state != OFF: - ink = QColor("#303030") - ink.setAlpha(200 if state != OFF else 150) - _paint_tape(painter, box, ink, half=(state == PARTIAL)) + ink.setAlpha(150) + if state == OFF: + _paint_tape(painter, box, ink) + 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() -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.""" w, h = box.width(), box.height() 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.78, body.bottom()) 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,