// Copyright (C) 2026 Danilo M. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. import QtQuick import "../.." Item { id: tab implicitHeight: col.implicitHeight readonly property int activeWidth: 70 readonly property int randomWidth: 90 // What the monitor shows: the last one previewed, or else the choice. property string previewed: "" readonly property string staged: previewed !== "" ? previewed : Transitions.draftPick !== "random" ? Transitions.draftPick : Transitions.draftPool[0] ?? "burn" property real progress: 0 property point origin: Qt.point(0.5, 0.5) function play(name) { previewed = name; origin = Qt.point(Math.random(), Math.random()); anim.restart(); } NumberAnimation { id: anim target: tab property: "progress" from: 0 to: 1 duration: Transitions.duration // ponytail: back on the old picture with a cut. onFinished: tab.progress = 0 } Column { id: col width: parent.width spacing: 14 MockScreen { anchors.horizontalCenter: parent.horizontalCenter panelWidth: Math.min(col.width, 640) panelHeight: Math.round(panelWidth * 1080 / 2560) TransitionView { anchors.fill: parent name: tab.staged progress: tab.progress origin: tab.origin } } Text { width: col.width horizontalAlignment: Text.AlignHCenter wrapMode: Text.Wrap text: (Transitions.all.find(t => t.name === tab.staged) ?? { label: "" }).label + ". Click a line to play it here; Active is what wallpaper changes use." color: Theme.overlay font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } } Column { width: col.width spacing: 2 Item { width: parent.width height: 22 Text { anchors { left: parent.left; leftMargin: 6; verticalCenter: parent.verticalCenter } text: "Transition" color: Theme.overlay font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } } Text { id: randomHead anchors { right: parent.right; verticalCenter: parent.verticalCenter } width: tab.randomWidth horizontalAlignment: Text.AlignHCenter text: "In Random" color: Theme.overlay font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } } Text { anchors { right: randomHead.left; verticalCenter: parent.verticalCenter } width: tab.activeWidth horizontalAlignment: Text.AlignHCenter text: "Active" color: Theme.overlay font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } } } Repeater { model: Transitions.all.concat([{ name: "random", label: "Random" }]) TransitionRow { required property var modelData width: parent.width name: modelData.name label: modelData.label activeWidth: tab.activeWidth randomWidth: tab.randomWidth onPreview: tab.play(name) onActivated: if (!random) tab.play(name) } } } } }