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++
1.2 KB
Raw Blame
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Rectangle {
    id: sw
    property bool checked: false
    signal toggled(bool checked)
    width: Theme.switchWidth
    height: Theme.switchHeight
    radius: 99
    color: checked ? Theme.accent : Qt.rgba(1, 1, 1, 0.14)
    Behavior on color { ColorAnimation { duration: Theme.d(250) } }

    Rectangle {
        id: knob
        width: tap.pressed ? 18 : Theme.switchKnob
        height: Theme.switchKnob
        radius: height / 2
        color: sw.checked ? Theme.accentInk : "#FFFFFF"
        anchors.verticalCenter: parent.verticalCenter
        x: sw.checked ? (parent.width - width - 3) : 3
        Behavior on x { NumberAnimation { duration: Theme.d(500); easing.bezierCurve: Theme.spring } }
        Behavior on width { NumberAnimation { duration: Theme.d(200) } }
    }
    HoverHandler { cursorShape: Qt.PointingHandCursor }
    // Controlled: owners bind checked to their model and write the new value back in
    // onToggled. Assigning checked here destroyed that binding, so a value changed
    // elsewhere (a preset, another page) no longer moved the switch (GitHub #29).
    TapHandler { id: tap; gesturePolicy: TapHandler.WithinBounds; onTapped: sw.toggled(!sw.checked) }
}