nosignal-shell/modules/nexus/common/ItemList.qml
28allday cf3c0d823d feat(nosignal): Nerd Font icon remap — nexus (Settings)
Convert caelestia's nexus Settings to Nerd Font icons (drop-in NsIcon).

- NsIcon hardened into a MaterialIcon drop-in: accepts fontStyle (sizes from
  it, keeps the NF Mono family), plus no-op fill/grade/animate for API parity.
- Glyphs map extended with caelestia core names: nexus static icons, nav/page
  icons (palette, wallpaper, dashboard, devices_other, extension, globe, info,
  monitor, shuffle, workspaces, ...), weather + app/device icons.
- Converted all MaterialIcon in modules/nexus/ to NsIcon; fixed icon aliases
  (NavRow/SliderRow .text -> .icon); reverted IconButton font: (it has font,
  not fontStyle, and renders its own icon).

Remaining core surfaces still Material Symbols (no breakage): launcher, osd,
lock, sidebar, utilities — to convert next with any further Glyphs entries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 11:16:01 +01:00

121 lines
2.8 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import Caelestia.Config
import qs.components
import qs.services
ConnectedRect {
id: root
property bool showList
property string placeholderIcon
property string placeholderText
property int extraHeight
property alias model: list.model
property alias delegate: list.delegate
readonly property alias list: list
Layout.fillWidth: true
implicitHeight: (showList && list.count > 0 ? list.contentHeight : placeholder.implicitHeight + Tokens.padding.extraLarge * 2) + extraHeight
color: Colours.tPalette.m3surfaceContainer
clip: true
Behavior on implicitHeight {
Anim {}
}
Loader {
id: placeholder
anchors.centerIn: parent
active: opacity > 0
opacity: root.showList && list.count > 0 ? 0 : 1
sourceComponent: ColumnLayout {
spacing: Tokens.spacing.extraSmall
NsIcon {
Layout.alignment: Qt.AlignHCenter
icon: root.placeholderIcon
color: Colours.palette.m3outline
fontStyle: Tokens.font.icon.large
animate: true
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: root.placeholderText
color: Colours.palette.m3outline
font: Tokens.font.body.large
animate: true
}
}
Behavior on opacity {
Anim {
type: Anim.DefaultEffects
}
}
}
ListView {
id: list
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: 0
interactive: false
opacity: root.showList ? 1 : 0
add: Transition {
Anim {
property: "opacity"
from: 0
to: 1
type: Anim.DefaultEffects
}
}
remove: Transition {
Anim {
property: "opacity"
to: 0
type: Anim.DefaultEffects
}
}
move: Transition {
Anim {
property: "opacity"
to: 1
type: Anim.DefaultEffects
}
Anim {
property: "y"
}
}
displaced: Transition {
Anim {
property: "opacity"
to: 1
type: Anim.DefaultEffects
}
Anim {
property: "y"
}
}
Behavior on opacity {
Anim {
type: Anim.DefaultEffects
}
}
}
}