Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++
3.4 KB
Raw Blame
// One stage in the effect chain, used by both list and node mode.
//
// The two pinned stages are visually locked: frame generation is always last and
// RTX Video HDR always sits immediately in front of it, because a stage after
// Video HDR would need HDR-aware handling that only frame generation has. The
// user asked for both pins, so the card shows a lock rather than a drag handle.
import QtQuick
import QtQuick.Layouts

Rectangle {
    id: card
    required property var node
    required property bool selected
    signal toggleRequested(bool enabled)
    signal removeRequested()
    signal selectRequested()

    readonly property bool locked: node.mustBeLast === true

    implicitHeight: 62
    radius: Theme.rCard
    color: selected ? Theme.card3 : Theme.card2
    border.width: 1
    border.color: selected ? Theme.accent : Theme.stroke
    Behavior on color { ColorAnimation { duration: Theme.d(Theme.durFast) } }
    Behavior on border.color { ColorAnimation { duration: Theme.d(Theme.durFast) } }

    RowLayout {
        anchors.fill: parent
        anchors.leftMargin: 12
        anchors.rightMargin: 12
        spacing: 10

        // Enable switch. A disabled stage stays in the chain: disabling is not
        // the same as removing, and the user asked to keep the chain editable.
        Rectangle {
            width: 34; height: 20; radius: 10
            Layout.alignment: Qt.AlignVCenter
            color: card.node.enabled ? Theme.accent : Theme.card3
            Behavior on color { ColorAnimation { duration: Theme.d(Theme.durFast) } }
            Rectangle {
                width: 14; height: 14; radius: 7
                color: card.node.enabled ? Theme.accentInk : Theme.t3
                anchors.verticalCenter: parent.verticalCenter
                x: card.node.enabled ? parent.width - width - 3 : 3
                Behavior on x { NumberAnimation { duration: Theme.d(Theme.durNormal); easing.bezierCurve: Theme.spring } }
            }
            HoverHandler { cursorShape: Qt.PointingHandCursor }
            TapHandler { gesturePolicy: TapHandler.WithinBounds; onTapped: card.toggleRequested(!card.node.enabled) }
        }

        ColumnLayout {
            Layout.fillWidth: true
            spacing: 1
            Text {
                text: card.node.label
                color: Theme.t1
                font.family: Theme.fontUi
                font.pixelSize: Theme.fsBody
            }
            Text {
                text: card.locked ? qsTr("固定为最后一步") : (card.node.experimental ? qsTr("实验") : "")
                visible: text.length > 0
                color: card.locked ? Theme.t3 : Theme.exp
                font.family: Theme.fontUi
                font.pixelSize: 10
            }
        }

        VIcon {
            visible: card.locked
            name: "key"
            size: 13
            color: Theme.t3
        }

        // Removing frame generation is refused by the engine too; greying it
        // here just avoids offering an action that cannot succeed.
        VIcon {
            name: "x"
            visible: !card.locked
            color: removeHover.hovered ? Theme.err : Theme.t3
            size: 14
            HoverHandler { id: removeHover; cursorShape: Qt.PointingHandCursor }
            TapHandler { gesturePolicy: TapHandler.WithinBounds; onTapped: card.removeRequested() }
        }
    }
    HoverHandler { id: cardHover }
    TapHandler { onTapped: card.selectRequested() }
}