2023-10-22 03:59:27 +00:00
|
|
|
// 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
|
2023-11-05 05:14:39 +00:00
|
|
|
import org.kde.kirigami as Kirigami
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2024-06-21 04:42:14 +00:00
|
|
|
import org.kde.private.mobile.homescreen.folio as Folio
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 05:14:39 +00:00
|
|
|
import 'private'
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
Item {
|
|
|
|
|
id: root
|
2024-06-21 04:42:14 +00:00
|
|
|
required property Folio.HomeScreen folio
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
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
|
2024-07-01 16:04:32 +00:00
|
|
|
z: 1
|
2023-10-22 03:59:27 +00:00
|
|
|
height: root.headerHeight
|
|
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
|
|
contentItem: root.headerItem
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AppDrawerGrid {
|
|
|
|
|
id: appDrawerGrid
|
2024-06-21 04:42:14 +00:00
|
|
|
folio: root.folio
|
2023-10-22 03:59:27 +00:00
|
|
|
homeScreen: root.homeScreen
|
|
|
|
|
height: parent.height - drawerHeader.height
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.bottom: parent.bottom
|
2025-03-20 02:06:33 +00:00
|
|
|
opacity: 0 // we display with the opacity gradient below
|
2023-11-05 05:14:39 +00:00
|
|
|
headerHeight: root.headerHeight
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// opacity gradient at grid edges
|
2025-03-20 02:06:33 +00:00
|
|
|
MobileShell.FlickableOpacityGradient {
|
2023-10-22 03:59:27 +00:00
|
|
|
anchors.fill: appDrawerGrid
|
2023-11-05 05:14:39 +00:00
|
|
|
flickable: appDrawerGrid
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|