Scaling: Replaced all Theme.uiScale by Theme.scale(Screen) so stuff scale accordingly to the Screen used by the Item/component
This commit is contained in:
parent
3148dc62a0
commit
cb74b6e5d5
50 changed files with 564 additions and 568 deletions
|
|
@ -8,15 +8,15 @@ import qs.Services
|
|||
|
||||
Rectangle {
|
||||
id: musicCard
|
||||
width: 360 * Theme.uiScale
|
||||
height: 250 * Theme.uiScale
|
||||
width: 360 * Theme.scale(Screen)
|
||||
height: 250 * Theme.scale(Screen)
|
||||
color: "transparent"
|
||||
|
||||
Rectangle {
|
||||
id: card
|
||||
anchors.fill: parent
|
||||
color: Theme.surface
|
||||
radius: 18 * Theme.uiScale
|
||||
radius: 18 * Theme.scale(Screen)
|
||||
|
||||
// Show fallback UI if no player is available
|
||||
Item {
|
||||
|
|
@ -26,12 +26,12 @@ Rectangle {
|
|||
|
||||
ColumnLayout {
|
||||
anchors.centerIn: parent
|
||||
spacing: 16 * Theme.uiScale
|
||||
spacing: 16 * Theme.scale(Screen)
|
||||
|
||||
Text {
|
||||
text: "music_note"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pixelSize: Theme.fontSizeHeader * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeHeader * Theme.scale(Screen)
|
||||
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.3)
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ Rectangle {
|
|||
text: MusicManager.hasPlayer ? "No controllable player selected" : "No music player detected"
|
||||
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.6)
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSizeSmall * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeSmall * Theme.scale(Screen)
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
}
|
||||
|
|
@ -49,45 +49,45 @@ Rectangle {
|
|||
// Main player UI
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 18 * Theme.uiScale
|
||||
spacing: 12 * Theme.uiScale
|
||||
anchors.margins: 18 * Theme.scale(Screen)
|
||||
spacing: 12 * Theme.scale(Screen)
|
||||
visible: !!MusicManager.currentPlayer
|
||||
|
||||
// Player selector
|
||||
ComboBox {
|
||||
id: playerSelector
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 40 * Theme.uiScale
|
||||
Layout.preferredHeight: 40 * Theme.scale(Screen)
|
||||
visible: MusicManager.getAvailablePlayers().length > 1
|
||||
model: MusicManager.getAvailablePlayers()
|
||||
textRole: "identity"
|
||||
currentIndex: MusicManager.selectedPlayerIndex
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 120 * Theme.uiScale
|
||||
implicitHeight: 40 * Theme.uiScale
|
||||
implicitWidth: 120 * Theme.scale(Screen)
|
||||
implicitHeight: 40 * Theme.scale(Screen)
|
||||
color: Theme.surfaceVariant
|
||||
border.color: playerSelector.activeFocus ? Theme.accentPrimary : Theme.outline
|
||||
border.width: 1 * Theme.uiScale
|
||||
radius: 16 * Theme.uiScale
|
||||
border.width: 1 * Theme.scale(Screen)
|
||||
radius: 16 * Theme.scale(Screen)
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
leftPadding: 12 * Theme.uiScale
|
||||
leftPadding: 12 * Theme.scale(Screen)
|
||||
rightPadding: playerSelector.indicator.width + playerSelector.spacing
|
||||
text: playerSelector.displayText
|
||||
font.pixelSize: 13 * Theme.uiScale
|
||||
font.pixelSize: 13 * Theme.scale(Screen)
|
||||
color: Theme.textPrimary
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
indicator: Text {
|
||||
x: playerSelector.width - width - 12 * Theme.uiScale
|
||||
x: playerSelector.width - width - 12 * Theme.scale(Screen)
|
||||
y: playerSelector.topPadding + (playerSelector.availableHeight - height) / 2
|
||||
text: "arrow_drop_down"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pixelSize: 24 * Theme.uiScale
|
||||
font.pixelSize: 24 * Theme.scale(Screen)
|
||||
color: Theme.textPrimary
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ Rectangle {
|
|||
y: playerSelector.height
|
||||
width: playerSelector.width
|
||||
implicitHeight: contentItem.implicitHeight
|
||||
padding: 1 * Theme.uiScale
|
||||
padding: 1 * Theme.scale(Screen)
|
||||
|
||||
contentItem: ListView {
|
||||
clip: true
|
||||
|
|
@ -109,8 +109,8 @@ Rectangle {
|
|||
background: Rectangle {
|
||||
color: Theme.surfaceVariant
|
||||
border.color: Theme.outline
|
||||
border.width: 1 * Theme.uiScale
|
||||
radius: 16 * Theme.uiScale
|
||||
border.width: 1 * Theme.scale(Screen)
|
||||
radius: 16 * Theme.scale(Screen)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ Rectangle {
|
|||
width: playerSelector.width
|
||||
contentItem: Text {
|
||||
text: modelData.identity
|
||||
font.pixelSize: 13 * Theme.uiScale
|
||||
font.pixelSize: 13 * Theme.scale(Screen)
|
||||
color: Theme.textPrimary
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
|
|
@ -138,14 +138,14 @@ Rectangle {
|
|||
|
||||
// Album art with spectrum visualizer
|
||||
RowLayout {
|
||||
spacing: 12 * Theme.uiScale
|
||||
spacing: 12 * Theme.scale(Screen)
|
||||
Layout.fillWidth: true
|
||||
|
||||
// Album art container with circular spectrum overlay
|
||||
Item {
|
||||
id: albumArtContainer
|
||||
width: 96 * Theme.uiScale
|
||||
height: 96 * Theme.uiScale // enough for spectrum and art (will adjust if needed)
|
||||
width: 96 * Theme.scale(Screen)
|
||||
height: 96 * Theme.scale(Screen) // enough for spectrum and art (will adjust if needed)
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
||||
|
||||
// Circular spectrum visualizer around album art
|
||||
|
|
@ -153,36 +153,36 @@ Rectangle {
|
|||
id: spectrum
|
||||
values: MusicManager.cavaValues
|
||||
anchors.centerIn: parent
|
||||
innerRadius: 30 * Theme.uiScale // Position just outside 60x60 album art
|
||||
outerRadius: 48 * Theme.uiScale // Extend bars outward from album art
|
||||
innerRadius: 30 * Theme.scale(Screen) // Position just outside 60x60 album art
|
||||
outerRadius: 48 * Theme.scale(Screen) // Extend bars outward from album art
|
||||
fillColor: Theme.accentPrimary
|
||||
strokeColor: Theme.accentPrimary
|
||||
strokeWidth: 0 * Theme.uiScale
|
||||
strokeWidth: 0 * Theme.scale(Screen)
|
||||
z: 0
|
||||
}
|
||||
|
||||
// Album art image
|
||||
Rectangle {
|
||||
id: albumArtwork
|
||||
width: 60 * Theme.uiScale
|
||||
height: 60 * Theme.uiScale
|
||||
width: 60 * Theme.scale(Screen)
|
||||
height: 60 * Theme.scale(Screen)
|
||||
anchors.centerIn: parent
|
||||
radius: 30 * Theme.uiScale // circle
|
||||
radius: 30 * Theme.scale(Screen) // circle
|
||||
color: Qt.darker(Theme.surface, 1.1)
|
||||
border.color: Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.3)
|
||||
border.width: 1 * Theme.uiScale
|
||||
border.width: 1 * Theme.scale(Screen)
|
||||
|
||||
Image {
|
||||
id: albumArt
|
||||
anchors.fill: parent
|
||||
anchors.margins: 2 * Theme.uiScale
|
||||
anchors.margins: 2 * Theme.scale(Screen)
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
smooth: true
|
||||
mipmap: true
|
||||
cache: false
|
||||
asynchronous: true
|
||||
sourceSize.width: 60 * Theme.uiScale
|
||||
sourceSize.height: 60 * Theme.uiScale
|
||||
sourceSize.width: 60 * Theme.scale(Screen)
|
||||
sourceSize.height: 60 * Theme.scale(Screen)
|
||||
source: MusicManager.trackArtUrl
|
||||
visible: source.toString() !== ""
|
||||
|
||||
|
|
@ -213,7 +213,7 @@ Rectangle {
|
|||
anchors.centerIn: parent
|
||||
text: "album"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pixelSize: Theme.fontSizeBody * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeBody * Theme.scale(Screen)
|
||||
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.4)
|
||||
visible: !albumArt.visible
|
||||
}
|
||||
|
|
@ -223,13 +223,13 @@ Rectangle {
|
|||
// Track metadata
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 4 * Theme.uiScale
|
||||
spacing: 4 * Theme.scale(Screen)
|
||||
|
||||
Text {
|
||||
text: MusicManager.trackTitle
|
||||
color: Theme.textPrimary
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSizeSmall * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeSmall * Theme.scale(Screen)
|
||||
font.bold: true
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.Wrap
|
||||
|
|
@ -241,7 +241,7 @@ Rectangle {
|
|||
text: MusicManager.trackArtist
|
||||
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.8)
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSizeCaption * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeCaption * Theme.scale(Screen)
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
|
@ -250,7 +250,7 @@ Rectangle {
|
|||
text: MusicManager.trackAlbum
|
||||
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.6)
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSizeCaption * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeCaption * Theme.scale(Screen)
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
|
@ -261,8 +261,8 @@ Rectangle {
|
|||
Rectangle {
|
||||
id: progressBarBackground
|
||||
width: parent.width
|
||||
height: 6 * Theme.uiScale
|
||||
radius: 3 * Theme.uiScale
|
||||
height: 6 * Theme.scale(Screen)
|
||||
radius: 3 * Theme.scale(Screen)
|
||||
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.15)
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
|
@ -290,12 +290,12 @@ Rectangle {
|
|||
// Interactive progress handle
|
||||
Rectangle {
|
||||
id: progressHandle
|
||||
width: 12 * Theme.uiScale
|
||||
height: 12 * Theme.uiScale
|
||||
radius: 6 * Theme.uiScale
|
||||
width: 12 * Theme.scale(Screen)
|
||||
height: 12 * Theme.scale(Screen)
|
||||
radius: 6 * Theme.scale(Screen)
|
||||
color: Theme.accentPrimary
|
||||
border.color: Qt.lighter(Theme.accentPrimary, 1.3)
|
||||
border.width: 1 * Theme.uiScale
|
||||
border.width: 1 * Theme.scale(Screen)
|
||||
|
||||
x: Math.max(0, Math.min(parent.width - width, progressFill.width - width / 2))
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
@ -334,18 +334,18 @@ Rectangle {
|
|||
|
||||
// Media controls
|
||||
RowLayout {
|
||||
spacing: 4 * Theme.uiScale
|
||||
spacing: 4 * Theme.scale(Screen)
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
// Previous button
|
||||
Rectangle {
|
||||
width: 28 * Theme.uiScale
|
||||
height: 28 * Theme.uiScale
|
||||
radius: 14 * Theme.uiScale
|
||||
width: 28 * Theme.scale(Screen)
|
||||
height: 28 * Theme.scale(Screen)
|
||||
radius: 14 * Theme.scale(Screen)
|
||||
color: previousButton.containsMouse ? Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.2) : Qt.darker(Theme.surface, 1.1)
|
||||
border.color: Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.3)
|
||||
border.width: 1 * Theme.uiScale
|
||||
border.width: 1 * Theme.scale(Screen)
|
||||
|
||||
MouseArea {
|
||||
id: previousButton
|
||||
|
|
@ -360,19 +360,19 @@ Rectangle {
|
|||
anchors.centerIn: parent
|
||||
text: "skip_previous"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pixelSize: Theme.fontSizeCaption * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeCaption * Theme.scale(Screen)
|
||||
color: previousButton.enabled ? Theme.accentPrimary : Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.3)
|
||||
}
|
||||
}
|
||||
|
||||
// Play/Pause button
|
||||
Rectangle {
|
||||
width: 36 * Theme.uiScale
|
||||
height: 36 * Theme.uiScale
|
||||
radius: 18 * Theme.uiScale
|
||||
width: 36 * Theme.scale(Screen)
|
||||
height: 36 * Theme.scale(Screen)
|
||||
radius: 18 * Theme.scale(Screen)
|
||||
color: playButton.containsMouse ? Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.2) : Qt.darker(Theme.surface, 1.1)
|
||||
border.color: Theme.accentPrimary
|
||||
border.width: 2 * Theme.uiScale
|
||||
border.width: 2 * Theme.scale(Screen)
|
||||
|
||||
MouseArea {
|
||||
id: playButton
|
||||
|
|
@ -387,19 +387,19 @@ Rectangle {
|
|||
anchors.centerIn: parent
|
||||
text: MusicManager.isPlaying ? "pause" : "play_arrow"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pixelSize: Theme.fontSizeBody * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeBody * Theme.scale(Screen)
|
||||
color: playButton.enabled ? Theme.accentPrimary : Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.3)
|
||||
}
|
||||
}
|
||||
|
||||
// Next button
|
||||
Rectangle {
|
||||
width: 28 * Theme.uiScale
|
||||
height: 28 * Theme.uiScale
|
||||
radius: 14 * Theme.uiScale
|
||||
width: 28 * Theme.scale(Screen)
|
||||
height: 28 * Theme.scale(Screen)
|
||||
radius: 14 * Theme.scale(Screen)
|
||||
color: nextButton.containsMouse ? Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.2) : Qt.darker(Theme.surface, 1.1)
|
||||
border.color: Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.3)
|
||||
border.width: 1 * Theme.uiScale
|
||||
border.width: 1 * Theme.scale(Screen)
|
||||
|
||||
MouseArea {
|
||||
id: nextButton
|
||||
|
|
@ -414,7 +414,7 @@ Rectangle {
|
|||
anchors.centerIn: parent
|
||||
text: "skip_next"
|
||||
font.family: "Material Symbols Outlined"
|
||||
font.pixelSize: Theme.fontSizeCaption * Theme.uiScale
|
||||
font.pixelSize: Theme.fontSizeCaption * Theme.scale(Screen)
|
||||
color: nextButton.enabled ? Theme.accentPrimary : Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.3)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue