diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-19 20:18:04 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-19 20:18:04 +1000 |
| commit | e4d2226dd0c84fa6e201f1c424cf5c3e0df24c0f (patch) | |
| tree | f8190f776be6768f0d7e49e9e5d44659be33b566 /modules/launcher/ContentList.qml | |
| parent | internal: make wallpaper dir configurable (diff) | |
| download | caelestia-shell-e4d2226dd0c84fa6e201f1c424cf5c3e0df24c0f.tar.gz caelestia-shell-e4d2226dd0c84fa6e201f1c424cf5c3e0df24c0f.tar.bz2 caelestia-shell-e4d2226dd0c84fa6e201f1c424cf5c3e0df24c0f.zip | |
launcher: better empty text
Also reload wallpapers when path changes
Diffstat (limited to 'modules/launcher/ContentList.qml')
| -rw-r--r-- | modules/launcher/ContentList.qml | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/modules/launcher/ContentList.qml b/modules/launcher/ContentList.qml index 93bb913..9c10077 100644 --- a/modules/launcher/ContentList.qml +++ b/modules/launcher/ContentList.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import "root:/widgets" import "root:/services" import "root:/config" +import "root:/utils" import Quickshell import QtQuick import QtQuick.Controls @@ -45,7 +46,7 @@ Item { PropertyChanges { root.currentList: wallpaperList.item - root.implicitWidth: Math.max(Config.launcher.sizes.itemWidth, wallpaperList.implicitWidth) + root.implicitWidth: Math.max(Config.launcher.sizes.itemWidth * 1.2, wallpaperList.implicitWidth) root.implicitHeight: Config.launcher.sizes.wallpaperHeight wallpaperList.active: true } @@ -107,39 +108,41 @@ Item { } } - Item { + Row { id: empty opacity: root.currentList?.count === 0 ? 1 : 0 scale: root.currentList?.count === 0 ? 1 : 0.5 - implicitWidth: icon.width + text.width + Appearance.spacing.small - implicitHeight: icon.height + spacing: Appearance.spacing.normal + padding: Appearance.padding.large anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter MaterialIcon { - id: icon - - text: "manage_search" + text: root.state === "wallpapers" ? "wallpaper_slideshow" : "manage_search" color: Colours.palette.m3onSurfaceVariant font.pointSize: Appearance.font.size.extraLarge anchors.verticalCenter: parent.verticalCenter } - StyledText { - id: text - - anchors.left: icon.right - anchors.leftMargin: Appearance.spacing.small + Column { anchors.verticalCenter: parent.verticalCenter - text: qsTr("No results") - color: Colours.palette.m3onSurfaceVariant - font.pointSize: Appearance.font.size.larger - font.weight: 500 + StyledText { + text: root.state === "wallpapers" ? qsTr("No wallpapers found") : qsTr("No results") + color: Colours.palette.m3onSurfaceVariant + font.pointSize: Appearance.font.size.larger + font.weight: 500 + } + + StyledText { + text: root.state === "wallpapers" && Wallpapers.list.length === 0 ? qsTr("Try putting some wallpapers in %1").arg(Paths.shortenHome(Config.paths.wallpaperDir)) : qsTr("Try searching for something else") + color: Colours.palette.m3onSurfaceVariant + font.pointSize: Appearance.font.size.normal + } } Behavior on opacity { |