shift-shell/containments/homescreens/folio/package/contents/ui/AppDrawer.qml
Devin Lin c2791f3975 homescreens/folio: Add applications drawer search bar
Add a search bar to the applications drawer, to allow for quickly filtering apps.
2024-07-01 16:04:32 +00:00

75 lines
2 KiB
QML

// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as Controls
import Qt5Compat.GraphicalEffects
import org.kde.plasma.components 3.0 as PC3
import org.kde.kirigami as Kirigami
import org.kde.plasma.private.mobileshell as MobileShell
import org.kde.private.mobile.homescreen.folio as Folio
import 'private'
Item {
id: root
required property Folio.HomeScreen folio
property var homeScreen
property real leftPadding: 0
property real topPadding: 0
property real bottomPadding: 0
property real rightPadding: 0
required property int headerHeight
required property var headerItem
// height from top of screen that the drawer starts
readonly property real drawerTopMargin: height - topPadding - bottomPadding
property alias flickable: appDrawerGrid
Item {
anchors.fill: parent
anchors.leftMargin: root.leftPadding
anchors.topMargin: root.topPadding
anchors.rightMargin: root.rightPadding
anchors.bottomMargin: root.bottomPadding
// drawer header
MobileShell.BaseItem {
id: drawerHeader
z: 1
height: root.headerHeight
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
contentItem: root.headerItem
}
AppDrawerGrid {
id: appDrawerGrid
folio: root.folio
homeScreen: root.homeScreen
height: parent.height - drawerHeader.height
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
opacity: 0
headerHeight: root.headerHeight
}
// opacity gradient at grid edges
FlickableOpacityGradient {
anchors.fill: appDrawerGrid
flickable: appDrawerGrid
}
}
}