pragma ComponentBehavior: Bound import Quickshell import QtQuick import qs.Paths import qs.Modules import qs.Components import qs.Helpers import ZShell.Config import qs.Services Item { id: root required property var content readonly property Item currentList: showWallpapers ? wallpaperList.item : appList.item required property real maxHeight required property int padding required property var panels required property int rounding required property SearchBar search readonly property bool showWallpapers: search.text.startsWith(`${Config.launcher.actionPrefix}wallpaper `) required property ScreenState screenState anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter clip: true state: showWallpapers ? "wallpapers" : "apps" Behavior on implicitHeight { enabled: root.screenState.launcher Anim { duration: Tokens.anim.durations.small easing: Tokens.anim.expressiveDefaultEffects } } Behavior on implicitWidth { enabled: root.screenState.launcher Anim { duration: Tokens.anim.durations.small easing: Tokens.anim.expressiveDefaultEffects } } Behavior on state { SequentialAnimation { Anim { duration: Tokens.anim.durations.small from: 1 property: "opacity" target: root to: 0 } PropertyAction {} Anim { duration: Tokens.anim.durations.small from: 0 property: "opacity" target: root to: 1 } } } states: [ State { name: "apps" PropertyChanges { appList.active: true root.implicitHeight: Math.min(root.maxHeight, appList.implicitHeight > 0 ? appList.implicitHeight : empty.implicitHeight) root.implicitWidth: Config.launcher.sizes.itemWidth } AnchorChanges { anchors.left: root.parent.left anchors.right: root.parent.right } }, State { name: "wallpapers" PropertyChanges { root.implicitHeight: Config.launcher.sizes.wallpaperHeight root.implicitWidth: Math.max(Config.launcher.sizes.itemWidth * 1.2, wallpaperList.implicitWidth) wallpaperList.active: true } } ] Loader { id: appList active: false anchors.fill: parent sourceComponent: AppList { search: root.search screenState: root.screenState } } Loader { id: wallpaperList active: false anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top width: root.implicitWidth sourceComponent: CarouselView { panels: root.panels search: root.search screenState: root.screenState } } Row { id: empty anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter opacity: root.currentList?.count === 0 ? 1 : 0 padding: Tokens.padding.large scale: root.currentList?.count === 0 ? 1 : 0.5 spacing: Tokens.spacing.medium Behavior on opacity { Anim {} } Behavior on scale { Anim {} } MaterialIcon { anchors.verticalCenter: parent.verticalCenter color: Colors.palette.m3onSurfaceVariant fontStyle: Tokens.font.icon.extraLarge text: root.state === "wallpapers" ? "wallpaper_slideshow" : "manage_search" } Column { anchors.verticalCenter: parent.verticalCenter CustomText { color: Colors.palette.m3onSurfaceVariant font: Tokens.font.body.builders.large.weight(Font.Medium).build() text: root.state === "wallpapers" ? qsTr("No wallpapers found") : qsTr("No results") } CustomText { color: Colors.palette.m3onSurfaceVariant font: Tokens.font.body.medium text: root.state === "wallpapers" && Wallpapers.list.length === 0 ? qsTr("Try putting some wallpapers in %1").arg(Paths.shortenHome(Paths.wallsdir)) : qsTr("Try searching for something else") } } } }