summaryrefslogtreecommitdiff
path: root/modules/launcher/Content.qml
diff options
context:
space:
mode:
Diffstat (limited to 'modules/launcher/Content.qml')
-rw-r--r--modules/launcher/Content.qml67
1 files changed, 62 insertions, 5 deletions
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml
index 2f9fcdd..5f99345 100644
--- a/modules/launcher/Content.qml
+++ b/modules/launcher/Content.qml
@@ -4,8 +4,14 @@ import Quickshell
import QtQuick
Item {
+ id: root
+
+ required property Scope launcher
+
implicitWidth: LauncherConfig.sizes.width
implicitHeight: search.height + list.height + Appearance.padding.large * 5 // Don't question it
+
+ anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
StyledRect {
@@ -22,12 +28,16 @@ Item {
ListView {
id: list
- model: DesktopEntries.applications.values.filter(x => x.name.toLowerCase().includes(search.text.toLowerCase()))
+ model: ScriptModel {
+ // TODO: sort
+ values: DesktopEntries.applications.values.filter(x => x.name.toLowerCase().includes(search.text.toLowerCase()))
+ }
+ clip: true
+ spacing: Appearance.spacing.small
orientation: Qt.Vertical
verticalLayoutDirection: Qt.BottomToTop
- height: 100
- width: 100
+ implicitHeight: ((currentItem?.height ?? 1) + spacing) * Math.min(10, count) - spacing
anchors.left: parent.left
anchors.right: parent.right
@@ -39,7 +49,8 @@ Item {
required property DesktopEntry modelData
- width: LauncherConfig.sizes.width
+ radius: Appearance.rounding.normal
+ color: Appearance.alpha(Appearance.colours.m3surfaceContainerHighest, true)
StyledText {
text: modelData.name
@@ -47,6 +58,40 @@ Item {
font.pointSize: Appearance.font.size.smaller
}
}
+
+ add: Transition {
+ Anim {
+ properties: "opacity,scale"
+ from: 0
+ to: 1
+ }
+ }
+
+ remove: Transition {
+ Anim {
+ properties: "opacity,scale"
+ from: 1
+ to: 0
+ }
+ }
+
+ addDisplaced: Transition {
+ Anim {
+ properties: "x,y"
+ duration: Appearance.anim.durations.small
+ }
+ }
+
+ removeDisplaced: Transition {
+ Anim {
+ properties: "x,y"
+ duration: Appearance.anim.durations.large
+ }
+ }
+
+ Behavior on implicitHeight {
+ Anim {}
+ }
}
}
@@ -58,11 +103,23 @@ Item {
anchors.bottom: parent.bottom
anchors.margins: Appearance.padding.large
- placeholderText: "Type \">\" for commands"
+ placeholderText: qsTr("Type \">\" for commands")
background: StyledRect {
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
radius: Appearance.rounding.large
}
+
+ // TODO: apps service with launch
+ // onAccepted: console.log(list.currentItem?.modelData.id)
+
+ // TODO: key press grab focus + close on esc anywhere
+ Keys.onEscapePressed: root.launcher.launcherVisible = false
+ }
+
+ component Anim: NumberAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
}
}