diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-02 23:13:09 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-02 23:13:09 +1000 |
| commit | 587760810cd22e57168caf369da6e6488ad6023a (patch) | |
| tree | d12575bd4651592163957098a7f201c54c9dcc51 /modules/launcher/Content.qml | |
| parent | launcher: auto grab focus + clear on close (diff) | |
| download | caelestia-shell-587760810cd22e57168caf369da6e6488ad6023a.tar.gz caelestia-shell-587760810cd22e57168caf369da6e6488ad6023a.tar.bz2 caelestia-shell-587760810cd22e57168caf369da6e6488ad6023a.zip | |
feat: launcher empty placeholder
Diffstat (limited to 'modules/launcher/Content.qml')
| -rw-r--r-- | modules/launcher/Content.qml | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml index d60991f..d994ee6 100644 --- a/modules/launcher/Content.qml +++ b/modules/launcher/Content.qml @@ -14,15 +14,17 @@ Item { readonly property int rounding: Appearance.rounding.large implicitWidth: LauncherConfig.sizes.width - implicitHeight: search.height + list.height + padding * 4 + spacing + implicitHeight: search.height + listWrapper.height + padding * 2 + spacing anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter StyledRect { + id: listWrapper + color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true) radius: root.rounding - implicitHeight: list.height + root.padding * 2 + implicitHeight: Math.max(empty.height, list.height) + root.padding * 2 anchors.left: parent.left anchors.right: parent.right @@ -51,6 +53,7 @@ Item { delegate: AppItem { launcher: root.launcher } + // TODO highlight ScrollBar.vertical: StyledScrollBar { // Move half out @@ -102,6 +105,12 @@ Item { Anim {} } } + + EmptyIndicator { + id: empty + + empty: list.count === 0 + } } StyledTextField { @@ -131,14 +140,18 @@ Item { } } - onVisibleChanged: { - if (visible) - forceActiveFocus(); - else - text = ""; - } - Keys.onEscapePressed: root.launcher.launcherVisible = false + + Connections { + target: root.launcher + + function onLauncherVisibleChanged(): void { + if (root.launcher.launcherVisible) + search.forceActiveFocus(); + else + search.text = ""; + } + } } component Anim: NumberAnimation { |