summaryrefslogtreecommitdiff
path: root/modules/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'modules/launcher')
-rw-r--r--modules/launcher/Background.qml2
-rw-r--r--modules/launcher/Content.qml68
-rw-r--r--modules/launcher/Launcher.qml17
-rw-r--r--modules/launcher/Wrapper.qml8
4 files changed, 77 insertions, 18 deletions
diff --git a/modules/launcher/Background.qml b/modules/launcher/Background.qml
index 429f12e..ae12712 100644
--- a/modules/launcher/Background.qml
+++ b/modules/launcher/Background.qml
@@ -19,7 +19,7 @@ Shape {
ShapePath {
strokeWidth: -1
- fillColor: Appearance.colours.m3surface
+ fillColor: Appearance.colours.m3surfaceContainer
startY: root.wrapperHeight
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml
new file mode 100644
index 0000000..2f9fcdd
--- /dev/null
+++ b/modules/launcher/Content.qml
@@ -0,0 +1,68 @@
+import "root:/widgets"
+import "root:/config"
+import Quickshell
+import QtQuick
+
+Item {
+ implicitWidth: LauncherConfig.sizes.width
+ implicitHeight: search.height + list.height + Appearance.padding.large * 5 // Don't question it
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ StyledRect {
+ color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
+ radius: Appearance.rounding.large
+ implicitHeight: list.height + Appearance.padding.large * 2
+
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: search.top
+ anchors.bottomMargin: Appearance.spacing.normal
+ anchors.margins: Appearance.padding.large
+
+ ListView {
+ id: list
+
+ model: DesktopEntries.applications.values.filter(x => x.name.toLowerCase().includes(search.text.toLowerCase()))
+
+ orientation: Qt.Vertical
+ verticalLayoutDirection: Qt.BottomToTop
+ height: 100
+ width: 100
+
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.margins: Appearance.padding.large
+
+ delegate: PaddedRect {
+ id: entry
+
+ required property DesktopEntry modelData
+
+ width: LauncherConfig.sizes.width
+
+ StyledText {
+ text: modelData.name
+ font.family: Appearance.font.family.sans
+ font.pointSize: Appearance.font.size.smaller
+ }
+ }
+ }
+ }
+
+ StyledTextField {
+ id: search
+
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.margins: Appearance.padding.large
+
+ placeholderText: "Type \">\" for commands"
+
+ background: StyledRect {
+ color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
+ radius: Appearance.rounding.large
+ }
+ }
+}
diff --git a/modules/launcher/Launcher.qml b/modules/launcher/Launcher.qml
index 245fd47..849a569 100644
--- a/modules/launcher/Launcher.qml
+++ b/modules/launcher/Launcher.qml
@@ -1,9 +1,7 @@
import "root:/widgets"
import "root:/config"
import Quickshell
-import QtQuick
-import QtQuick.Shapes
-import Qt5Compat.GraphicalEffects
+import Quickshell.Wayland
Scope {
id: root
@@ -20,6 +18,8 @@ Scope {
id: win
name: "launcher"
+ keyboardFocus: root.launcherVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
+ visible: wrapper.shouldBeVisible
width: content.width + bg.rounding * 2
height: content.implicitHeight
@@ -37,17 +37,8 @@ Scope {
launcherVisible: root.launcherVisible
- PaddedRect {
+ Content {
id: content
-
- width: LauncherConfig.sizes.width
- padding: Appearance.padding.large
- anchors.horizontalCenter: parent.horizontalCenter
-
- StyledText {
- text: "Launcher"
- font.pointSize: 80
- }
}
}
}
diff --git a/modules/launcher/Wrapper.qml b/modules/launcher/Wrapper.qml
index 17e7b3a..ed08ba1 100644
--- a/modules/launcher/Wrapper.qml
+++ b/modules/launcher/Wrapper.qml
@@ -5,13 +5,13 @@ Item {
id: root
required property bool launcherVisible
+ property bool shouldBeVisible
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 0
- visible: false
clip: true
@@ -21,7 +21,7 @@ Item {
PropertyChanges {
root.height: content.height
- root.visible: true
+ root.shouldBeVisible: true
}
}
@@ -33,7 +33,7 @@ Item {
SequentialAnimation {
PropertyAction {
target: root
- property: "visible"
+ property: "shouldBeVisible"
}
NumberAnimation {
target: root
@@ -58,7 +58,7 @@ Item {
}
PropertyAction {
target: root
- property: "visible"
+ property: "shouldBeVisible"
}
}
}