Skip to content

Commit

Permalink
fix audio player size when text is too big
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Feb 24, 2025
1 parent 3fc10e1 commit 1010110
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion qml/desktop/AudioPlayer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Item {
color: Qt.rgba(255, 255, 255, 0.2)
Rectangle {
height: parent.height
width: parent.width * (playerModel.elapsed / playerModel.duration)
width: parent.width * Math.min(1, Math.max(0, playerModel.elapsed / playerModel.duration))
color: "#3AB4D7"
}
}
Expand Down Expand Up @@ -282,6 +282,8 @@ Item {
font { family: calaosFont.fontFamily; weight: Font.ExtraLight; pointSize: 10 }
text: playerModel.artist === ""? "N/A": playerModel.artist
color: playerModel.status === Common.StatusPlay? "#3AB4D7": "#848484"
Layout.fillWidth: true
elide: Text.ElideRight
}

Text {
Expand All @@ -294,6 +296,8 @@ Item {
font { family: calaosFont.fontFamily; weight: Font.ExtraLight; pointSize: 10 }
text: playerModel.album === ""? "N/A": playerModel.album
color: playerModel.status === Common.StatusPlay? "#3AB4D7": "#848484"
Layout.fillWidth: true
elide: Text.ElideRight
}

Text {
Expand All @@ -306,6 +310,8 @@ Item {
font { family: calaosFont.fontFamily; weight: Font.ExtraLight; pointSize: 10 }
text: playerModel.title === ""? "N/A": playerModel.title
color: playerModel.status === Common.StatusPlay? "#3AB4D7": "#848484"
Layout.fillWidth: true
elide: Text.ElideRight
}

Text {
Expand All @@ -318,6 +324,8 @@ Item {
font { family: calaosFont.fontFamily; weight: Font.ExtraLight; pointSize: 10 }
text: playerModel.genre === ""? "N/A": playerModel.genre
color: playerModel.status === Common.StatusPlay? "#3AB4D7": "#848484"
Layout.fillWidth: true
elide: Text.ElideRight
}

Text {
Expand All @@ -330,6 +338,8 @@ Item {
font { family: calaosFont.fontFamily; weight: Font.ExtraLight; pointSize: 10 }
text: playerModel.duration === ""? "N/A": Utils.time2string_digit(playerModel.duration)
color: playerModel.status === Common.StatusPlay? "#3AB4D7": "#848484"
Layout.fillWidth: true
elide: Text.ElideRight
}
}
}
Expand Down

0 comments on commit 1010110

Please sign in to comment.