Files
Nebula-OS/packages/nebula-ui/qml/Nebula/UI/NebulaIconButton.qml
T
andrew befed8ff96 Add Qt/QML desktop shell and Nebula.UI
Introduce a new production desktop shell at `shells/desktop/shell` built with C++20, Qt Quick/QML, and LayerShellQt, including top bar, launcher, desktop surfaces, shell state, and mock app data. Add the shared `packages/nebula-ui` QML module (theme, controls, focus, icons) and wire it into the shell build.

Retire the old GTK/WebKit native host by removing `shells/desktop/native`, move the React shell UI to `shells/desktop/prototype-react` as an archived design reference, and update root/compositor/session documentation to reflect the new Linux-only production architecture and temporary Sway role.
2026-08-26 16:34:40 +12:00

67 lines
1.4 KiB
QML

import QtQuick
Item {
id: root
property string label: ""
property bool active: false
property bool danger: false
readonly property bool hovered: hover.containsMouse
readonly property color iconColor: {
if (danger && hovered)
return Theme.danger
if (active)
return Theme.accentStrong
if (hovered)
return Theme.textPrimary
return Theme.textSecondary
}
default property alias icon: iconHolder.data
signal clicked()
implicitWidth: Theme.controlHeight
implicitHeight: Theme.controlHeight
Accessible.role: Accessible.Button
Accessible.name: root.label
Accessible.onPressAction: root.clicked()
Rectangle {
anchors.fill: parent
radius: Theme.radiusSmall
color: {
if (root.active)
return Theme.accentSoft
if (hover.containsMouse)
return Theme.hoverFill
return "transparent"
}
Behavior on color {
ColorAnimation {
duration: Theme.animationFast
}
}
}
Item {
id: iconHolder
anchors.centerIn: parent
width: 16
height: 16
}
MouseArea {
id: hover
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()
}
FocusFrame {
radius: Theme.radiusSmall
}
}