Fix the play slider and time label so that they don't overflow the bubble when thin.

The time label now appears below the duration slider when very thin.
Remove unnecessary padding from the audio inner object, including deleting the outer control which added padding but little else.
This commit is contained in:
James Graham
2022-10-17 20:26:58 +01:00
committed by Tobias Fella
parent 1c9575ccfd
commit 2ced0c902e

View File

@@ -21,8 +21,7 @@ TimelineContainer {
onDownloadedChanged: audio.play() onDownloadedChanged: audio.play()
hoverComponent: hoverActions hoverComponent: hoverActions
innerObject: Control { innerObject: ColumnLayout {
Layout.fillWidth: true
Layout.maximumWidth: audioDelegate.contentMaxWidth Layout.maximumWidth: audioDelegate.contentMaxWidth
Audio { Audio {
@@ -82,41 +81,47 @@ TimelineContainer {
} }
] ]
contentItem: ColumnLayout { RowLayout {
RowLayout { ToolButton {
ToolButton { id: playButton
id: playButton
}
Label {
text: model.display
wrapMode: Text.Wrap
Layout.fillWidth: true
}
} }
ProgressBar { Label {
id: downloadBar text: model.display
visible: false wrapMode: Text.Wrap
Layout.fillWidth: true
}
}
ProgressBar {
id: downloadBar
visible: false
Layout.fillWidth: true
from: 0
to: model.content.info.size
value: model.progressInfo.progress
}
RowLayout {
visible: audio.hasAudio
Slider {
Layout.fillWidth: true Layout.fillWidth: true
from: 0 from: 0
to: model.content.info.size to: audio.duration
value: model.progressInfo.progress value: audio.position
onMoved: audio.seek(value)
} }
RowLayout {
visible: audio.hasAudio
Layout.leftMargin: Kirigami.Units.largeSpacing
Layout.rightMargin: Kirigami.Units.largeSpacing
Slider { Label {
from: 0 visible: audioDelegate.contentMaxWidth > Kirigami.Units.gridUnit * 12
to: audio.duration
value: audio.position
onMoved: audio.seek(value)
}
Label { text: Controller.formatDuration(audio.position) + "/" + Controller.formatDuration(audio.duration)
text: Controller.formatDuration(audio.position) + "/" + Controller.formatDuration(audio.duration)
}
} }
} }
Label {
Layout.alignment: Qt.AlignRight
Layout.rightMargin: Kirigami.Units.smallSpacing
visible: audio.hasAudio && audioDelegate.contentMaxWidth < Kirigami.Units.gridUnit * 12
text: Controller.formatDuration(audio.position) + "/" + Controller.formatDuration(audio.duration)
}
} }
} }