summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-02 14:57:59 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-02 14:57:59 +1000
commit651378d4965e1255abd524fd320f375639cd8bca (patch)
tree447f257b511354a147c3f0df5cc04efe1a2e70d8
parentrefactor: separate launcher into multiple files (diff)
downloadcaelestia-shell-651378d4965e1255abd524fd320f375639cd8bca.tar.gz
caelestia-shell-651378d4965e1255abd524fd320f375639cd8bca.tar.bz2
caelestia-shell-651378d4965e1255abd524fd320f375639cd8bca.zip
launcher: add content
Also use surfaceContainer as background
-rw-r--r--config/Appearance.qml2
-rw-r--r--modules/bar/Panel.qml2
-rw-r--r--modules/bar/Pills.qml2
-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
-rw-r--r--widgets/StyledTextField.qml31
8 files changed, 111 insertions, 21 deletions
diff --git a/config/Appearance.qml b/config/Appearance.qml
index 1a2f059..dcd1308 100644
--- a/config/Appearance.qml
+++ b/config/Appearance.qml
@@ -59,7 +59,7 @@ Singleton {
}
component Transparency: QtObject {
- readonly property bool enabled: true
+ readonly property bool enabled: false
readonly property real base: 0.78
readonly property real layers: 0.58
}
diff --git a/modules/bar/Panel.qml b/modules/bar/Panel.qml
index fa71cf7..901c766 100644
--- a/modules/bar/Panel.qml
+++ b/modules/bar/Panel.qml
@@ -13,7 +13,7 @@ StyledRect {
}
vertical: BarConfig.vertical
- color: Appearance.alpha(Appearance.colours.m3surface, false)
+ color: Appearance.alpha(Appearance.colours.m3surfaceContainer, false)
anchors.fill: parent
BoxLayout {
diff --git a/modules/bar/Pills.qml b/modules/bar/Pills.qml
index 556870d..b6b9288 100644
--- a/modules/bar/Pills.qml
+++ b/modules/bar/Pills.qml
@@ -107,7 +107,7 @@ BoxLayout {
}
component Pill: PaddedRect {
- color: Appearance.alpha(Appearance.colours.m3surface, false)
+ color: Appearance.alpha(Appearance.colours.m3surfaceContainer, false)
radius: Appearance.rounding.full
padding: BarConfig.vertical ? [Appearance.padding.large, 0] : [0, Appearance.padding.large]
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"
}
}
}
diff --git a/widgets/StyledTextField.qml b/widgets/StyledTextField.qml
new file mode 100644
index 0000000..f6232f2
--- /dev/null
+++ b/widgets/StyledTextField.qml
@@ -0,0 +1,31 @@
+pragma ComponentBehavior: Bound
+
+import "root:/config"
+import QtQuick
+import QtQuick.Controls
+
+TextField {
+ id: root
+
+ renderType: TextField.NativeRendering
+ color: Appearance.colours.m3onSurface
+ placeholderTextColor: Appearance.colours.m3outline
+ font.family: Appearance.font.family.sans
+ font.pointSize: Appearance.font.size.smaller
+
+ Behavior on color {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+
+ Behavior on placeholderTextColor {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+}