Scale all QML elements according to the current display size

This commit is contained in:
Jan-Martin Raemer 2022-06-03 22:07:50 +02:00
parent 9e7a55fc20
commit bcdf3d94f2
15 changed files with 278 additions and 109 deletions

View file

@ -1,51 +1,52 @@
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtQuick.Controls.Styles 1.4
Item {
ColumnLayout {
id: container
property var model
// manually set height
Component.onCompleted: height = childrenRect.height
spacing: StyleSpacings.tinySpacing
Label{
anchors.left: progress.left
anchors.bottom: progress.top
font.pointSize: 9
color: "grey"
text: model.pMediaTitle
}
RowLayout{
Label{
font.pointSize: 9
color: "grey"
text: model.pMediaTitle
}
Item{
// spacer
Layout.fillWidth: true
}
Label{
anchors.right: progress.right
anchors.bottom: progress.top
font.pointSize: 9
color: "grey"
text: model.pTime + " / " + model.pMediaLength
Label{
font.pointSize: 9
color: "grey"
text: model.pTime + " / " + model.pMediaLength
}
}
ProgressBar{
id: progress
anchors.top: parent.top
anchors.left: parent.left
Layout.fillWidth: true
value: model.pProgress
style:ProgressBarStyle {
background: Rectangle {
radius: 5
radius: StyleSizes.progressBackgroundRadius
color: "white"
border.color: "grey"
border.width: 1
border.width: StyleSizes.progressBackgroundBorderWidth
implicitWidth: container.width
implicitHeight: 10
implicitHeight: StyleSizes.progressBackgroundDefaultHeight
}
progress: Rectangle {
color: "blue"
border.color: "blue"
radius: 5
implicitHeight: 8
radius: StyleSizes.progressBackgroundRadius
implicitHeight: StyleSizes.progressBarDefaultHeight
}
}
}