nosignal-shell/modules/launcher/AppList.qml
2 * r + 2 * t 587c3a7bc9 feat: launcher keyboard nav
Using currentitem and highlight
Also fix not closing launcher when clicking app
Apps service use only one process
2025-05-02 23:35:22 +10:00

96 lines
2.1 KiB
QML

import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import QtQuick
import QtQuick.Controls
ListView {
id: root
required property int padding
required property string search
required property Scope launcher
model: ScriptModel {
values: Apps.fuzzyQuery(root.search)
onValuesChanged: root.currentIndex = 0
}
clip: true
spacing: Appearance.spacing.small
orientation: Qt.Vertical
implicitHeight: ((currentItem?.height ?? 1) + spacing) * Math.min(LauncherConfig.maxShown, count) - spacing
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: root.padding
highlightMoveDuration: Appearance.anim.durations.normal
highlight: StyledRect {
radius: Appearance.rounding.normal
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHighest, true)
}
delegate: AppItem {
launcher: root.launcher
}
ScrollBar.vertical: StyledScrollBar {
// Move half out
parent: root.parent
anchors.top: root.top
anchors.bottom: root.bottom
anchors.right: root.right
anchors.topMargin: root.padding / 2
anchors.bottomMargin: root.padding / 2
anchors.rightMargin: -root.padding / 2
}
add: Transition {
Anim {
properties: "opacity,scale"
from: 0
to: 1
}
}
remove: Transition {
Anim {
properties: "opacity,scale"
from: 1
to: 0
}
}
move: Transition {
Anim {
property: "y"
}
}
addDisplaced: Transition {
Anim {
property: "y"
duration: Appearance.anim.durations.small
}
}
displaced: Transition {
Anim {
property: "y"
}
}
Behavior on implicitHeight {
Anim {}
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}