diff options
author | Be <be@mixxx.org> | 2021-09-27 14:54:14 -0500 |
---|---|---|
committer | Be <be@mixxx.org> | 2021-09-29 10:11:33 -0500 |
commit | d4bf033f4f16d811040ddb44a5bccc882e738c48 (patch) | |
tree | d05c7a52e9ca73205f3a8d4ded1914993aaf38fc /res/qml/DeckRow.qml | |
parent | 9b7f745691fe8f21af29ca64dd44a7c42651f953 (diff) |
move res/skins/QMLDemo to res/qml
Diffstat (limited to 'res/qml/DeckRow.qml')
-rw-r--r-- | res/qml/DeckRow.qml | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/res/qml/DeckRow.qml b/res/qml/DeckRow.qml new file mode 100644 index 0000000000..b4f9cb96a0 --- /dev/null +++ b/res/qml/DeckRow.qml @@ -0,0 +1,125 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +Item { + id: root + + property string leftDeckGroup // required + property string rightDeckGroup // required + property alias mixer: mixer + property bool minimized: false + + implicitHeight: mixer.height + states: [ + State { + when: root.minimized + name: "minimized" + + PropertyChanges { + target: mixer + visible: false + } + + PropertyChanges { + target: root + implicitHeight: 66 + } + + AnchorChanges { + target: leftDeck + anchors.right: mixer.horizontalCenter + } + + AnchorChanges { + target: rightDeck + anchors.left: mixer.horizontalCenter + } + + }, + State { + // This State can't be deduplicated by making the first one + // reversible, because for decks 3/4 the mixer may already be + // hidden (since the whole deck row is already hidden). In that + // case, disabling the minimized state would not show the mixer + // again. + when: !root.minimized + name: "maximized" + + PropertyChanges { + target: mixer + visible: true + } + + PropertyChanges { + target: root + implicitHeight: mixer.height + } + + AnchorChanges { + target: leftDeck + anchors.right: mixer.left + } + + AnchorChanges { + target: rightDeck + anchors.left: mixer.right + } + + } + ] + + Deck { + id: leftDeck + + minimized: root.minimized + anchors.top: parent.top + anchors.left: parent.left + anchors.bottom: parent.bottom + group: root.leftDeckGroup + } + + Mixer { + id: mixer + + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + leftDeckGroup: root.leftDeckGroup + rightDeckGroup: root.rightDeckGroup + + FadeBehavior on visible { + fadeTarget: mixer + } + + } + + Deck { + id: rightDeck + + minimized: root.minimized + anchors.top: parent.top + anchors.right: parent.right + anchors.bottom: parent.bottom + group: root.rightDeckGroup + } + + transitions: Transition { + to: "minimized" + reversible: true + + SequentialAnimation { + AnchorAnimation { + targets: [leftDeck, rightDeck] + duration: 150 + } + + PropertyAnimation { + target: root + property: "implicitHeight" + duration: 150 + } + + } + + } + +} |