phoebus_os/installer/live/desktop/common/PhoebusButton.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

68 lines
2.1 KiB
Bash

import QtQuick
// A keyboard-focusable, branded button. Primary buttons are amber; secondary
// buttons are a raised surface. Focus is always visible.
Rectangle {
id: btn
property string label: ""
property bool primary: false
property bool danger: false
property bool compact: false
property bool actionEnabled: true
signal clicked
readonly property bool hovered: mouse.containsMouse
readonly property color baseBg: {
if (danger)
return Qt.darker(Theme.danger, 1.25);
if (primary)
return hovered ? Theme.amber : Theme.amberDeep;
return hovered ? Theme.surfaceRaised : Theme.surface;
}
implicitHeight: compact ? 34 : 46
implicitWidth: Math.max(compact ? 80 : 120, labelText.implicitWidth + (compact ? 28 : 48))
radius: Theme.radiusSmall
color: actionEnabled ? baseBg : Theme.surface
border.width: (primary || danger) ? 0 : 1
border.color: activeFocus ? Theme.focusRing : Theme.border
opacity: actionEnabled ? 1 : 0.55
activeFocusOnTab: true
Accessible.role: Accessible.Button
Accessible.name: label
Accessible.onPressAction: if (actionEnabled) btn.clicked()
Keys.onReturnPressed: if (btn.actionEnabled) btn.clicked()
Keys.onEnterPressed: if (btn.actionEnabled) btn.clicked()
Keys.onSpacePressed: if (btn.actionEnabled) btn.clicked()
Rectangle {
anchors.fill: parent
anchors.margins: -3
radius: btn.radius + 3
color: "transparent"
border.width: 2
border.color: Theme.focusRing
visible: btn.activeFocus
}
Text {
id: labelText
anchors.centerIn: parent
text: btn.label
color: (btn.primary || btn.danger) ? Theme.charcoal : Theme.warmWhite
font.family: Theme.family
font.pixelSize: btn.compact ? Theme.fontSmall : Theme.fontBody
font.weight: btn.primary ? Font.DemiBold : Font.Normal
}
MouseArea {
id: mouse
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
enabled: btn.actionEnabled
onClicked: btn.clicked()
}
}