phoebus_os/installer/live/desktop/common/PhoebusToggle.qml
Phoebus 7e9fa9c2a3
Some checks are pending
ci / test (push) Waiting to run
feat(installer): graphical welcome and install wizard over a typed bridge
Add a branded live welcome window and a Quickshell/QML installer frontend
over a narrow, fail-closed JSON bridge (phoebus-installer --gui-bridge)
that reuses the same InstallConfig, plan, validation, authorization and
staged executor as the TUI/CLI. Add the Phoebus brand system (emblem,
wordmark, wallpaper, tokens), suppress DMS first-run dialogs on the live
medium, identify the live medium as protected, make the installer
shortcut live-only, and fix the installed boot default so systemd-boot
never selects the recovery entry.

Verified in a disposable graphical VM (welcome/installer journey,
duplicate prevention, keyboard navigation, blocked AI prerequisite) plus
a real non-interactive install and detached boot (INSTALL-RC=0,
NO_SECRET_LEAK, systemd running, 0 failed units, LUKS2, Btrfs, network).
2026-09-21 13:13:40 -07:00

83 lines
2.3 KiB
Bash

import QtQuick
// A label + switch. Clickable and keyboard-operable (Space/Enter).
Item {
id: toggle
property string label: ""
property string description: ""
property bool checked: false
signal toggled(bool value)
implicitHeight: description.length > 0 ? 52 : 36
width: parent ? parent.width : implicitWidth
activeFocusOnTab: true
Accessible.role: Accessible.CheckBox
Accessible.name: label
Accessible.checked: checked
Keys.onSpacePressed: {
toggle.checked = !toggle.checked;
toggle.toggled(toggle.checked);
}
Keys.onReturnPressed: Keys.onSpacePressed(event)
Keys.onEnterPressed: Keys.onSpacePressed(event)
Column {
anchors.left: parent.left
anchors.right: switchBox.left
anchors.rightMargin: 16
anchors.verticalCenter: parent.verticalCenter
spacing: 2
Text {
width: parent.width
text: toggle.label
color: Theme.warmWhite
font.family: Theme.family
font.pixelSize: Theme.fontBody
}
Text {
width: parent.width
text: toggle.description
color: Theme.muted
font.family: Theme.family
font.pixelSize: Theme.fontSmall
wrapMode: Text.WordWrap
visible: toggle.description.length > 0
}
}
Rectangle {
id: switchBox
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: 44
height: 24
radius: 12
color: toggle.checked ? Theme.amberDeep : Theme.border
border.width: toggle.activeFocus ? 2 : 0
border.color: Theme.focusRing
Rectangle {
width: 18
height: 18
radius: 9
y: 3
x: toggle.checked ? parent.width - width - 3 : 3
color: toggle.checked ? Theme.warmWhite : Theme.muted
Behavior on x {
NumberAnimation { duration: 90 }
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
toggle.forceActiveFocus();
toggle.checked = !toggle.checked;
toggle.toggled(toggle.checked);
}
}
}
}