wactioncenter: media controls

This commit is contained in:
end-4
2025-11-23 21:35:43 +01:00
parent c78c363388
commit 07f8a72d6d
23 changed files with 348 additions and 130 deletions
@@ -1,3 +1,4 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -12,28 +13,52 @@ import qs.modules.waffle.actionCenter.mainPage
WBarAttachedPanelContent {
id: root
contentItem: WStackView {
id: stackView
anchors.fill: parent
implicitWidth: initItem.implicitWidth
implicitHeight: initItem.implicitHeight
initialItem: PageColumn {
id: initItem
MainPageBody {}
Separator {}
MainPageFooter {}
readonly property bool barAtBottom: Config.options.waffles.bar.bottom
contentItem: Column {
// This somewhat sophisticated anchoring is needed to make opening anim not jump abruptly when stuff appear
anchors {
left: parent.left
right: parent.right
top: root.barAtBottom ? undefined : parent.top
bottom: root.barAtBottom ? parent.bottom : undefined
margins: root.visualMargin
}
spacing: 12
Component.onCompleted: {
ActionCenterContext.stackView = this
WPane {
visible: MprisController.activePlayer != null && MprisController.isRealPlayer(MprisController.activePlayer)
anchors {
left: parent.left
right: parent.right
}
contentItem: MediaPaneContent {}
}
WPane {
contentItem: WStackView {
id: stackView
anchors.fill: parent
implicitWidth: initItem.implicitWidth
implicitHeight: initItem.implicitHeight
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.BackButton
onClicked: {
ActionCenterContext.back()
initialItem: PageColumn {
id: initItem
MainPageBody {}
Separator {}
MainPageFooter {}
}
Component.onCompleted: {
ActionCenterContext.stackView = this;
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.BackButton
onClicked: {
ActionCenterContext.back();
}
}
}
}
}