Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 9 additions & 23 deletions BarWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ BarWidget {
nowProcess.running = true
}

implicitWidth: row.implicitWidth + Style.space(14)
implicitWidth: Style.space(32)
implicitHeight: barSize

FileView {
Expand Down Expand Up @@ -121,30 +121,16 @@ BarWidget {
onTriggered: root.refreshNowPlaying()
}

Row {
id: row
SubwaveMark {
id: mark
anchors.centerIn: parent
spacing: Style.space(6)

Text {
anchors.verticalCenter: parent.verticalCenter
text: "󰝚"
color: root.playerRunning && !root.playerPaused && root.stationOnline
? Color.accent : root.bar.barForeground
font.family: root.bar.fontFamily
font.pixelSize: Style.font.body
}
width: Math.min(Style.space(20), root.barSize - Style.space(6))
height: width
opacity: root.playerRunning
? (!root.playerPaused && root.stationOnline ? 1 : 0.55)
: 0.82

Text {
visible: !root.vertical
width: Math.min(implicitWidth, Style.space(180))
anchors.verticalCenter: parent.verticalCenter
text: root.label
color: root.bar.barForeground
font.family: root.bar.fontFamily
font.pixelSize: Style.font.body
elide: Text.ElideRight
}
Behavior on opacity { NumberAnimation { duration: 120 } }
}

MouseArea {
Expand Down
8 changes: 8 additions & 0 deletions SubwaveMark.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import QtQuick

Image {
source: Qt.resolvedUrl("subwave-mark.svg")
fillMode: Image.PreserveAspectFit
smooth: true
mipmap: true
}
27 changes: 27 additions & 0 deletions subwave-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions tests/run
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ node "$root/tests/model.test.mjs"
bash "$root/tests/fetch.test.sh"
bash "$root/tests/player.test.sh"

if [[ -x /usr/lib/qt6/bin/qmltestrunner ]]; then
QT_QPA_PLATFORM=offscreen QT_QUICK_BACKEND=software \
/usr/lib/qt6/bin/qmltestrunner \
-input "$root/tests/tst_subwavemark.qml" \
-import "$root" \
-o -,txt
fi

if command -v omarchy >/dev/null 2>&1; then
omarchy plugin validate "$root"
fi
Expand Down
21 changes: 21 additions & 0 deletions tests/tst_subwavemark.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import QtQuick
import QtTest

TestCase {
id: testCase
name: "SubwaveMark"

function test_loadsBrandedArtworkAtCompactSize() {
var component = Qt.createComponent("../SubwaveMark.qml")
tryCompare(component, "status", Component.Ready)

var mark = component.createObject(testCase, { width: 20, height: 20 })
verify(mark !== null)
tryCompare(mark, "status", Image.Ready)
compare(mark.width, 20)
compare(mark.height, 20)
verify(mark.paintedWidth > 0)
verify(mark.paintedHeight > 0)
mark.destroy()
}
}
Loading