forked from Shinonome/dots-hyprland
wactioncenter: media controls
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user