Warning, /libraries/kirigami-addons/tests/bottom-drawer.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2023 Mathis BrĂ¼chert <mbb@kaidan.im>
0002 //
0003 // SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004
0005 import QtQuick
0006 import QtQuick.Controls as QQC2
0007 import QtQuick.Layouts
0008 import org.kde.kirigami as Kirigami
0009 import org.kde.kirigamiaddons.components as Components
0010 import org.kde.kirigamiaddons.delegates as Delegates
0011
0012 QQC2.ApplicationWindow {
0013 id: root
0014
0015 height: 800
0016 width: 600
0017
0018 visible: true
0019
0020 Components.FloatingButton {
0021 icon.name: "configure"
0022 text: "Open Drawer"
0023
0024 margins: Kirigami.Units.largeSpacing
0025
0026 anchors {
0027 right: parent.right
0028 bottom: parent.bottom
0029 }
0030
0031 onClicked: drawer.open()
0032 }
0033
0034 Components.BottomDrawer {
0035 id: drawer
0036 width: root.width
0037
0038 headerContentItem: RowLayout {
0039 Components.Avatar {
0040 name: "World"
0041 }
0042
0043 ColumnLayout {
0044 Layout.leftMargin: Kirigami.Units.largeSpacing
0045 Layout.fillWidth: true
0046
0047 Kirigami.Heading {
0048 text: "John Doe"
0049 Layout.fillWidth: true
0050 }
0051 QQC2.Label {
0052 text: "Last connection: 20.04.2042"
0053 Layout.fillWidth: true
0054 }
0055 }
0056 }
0057
0058 QQC2.ScrollView {
0059 implicitHeight: Math.max(view.implicitHeight, root.height * 0.8)
0060
0061 ListView {
0062 id: view
0063
0064 model: 40
0065
0066 delegate: Delegates.RoundedItemDelegate {
0067 required property int index
0068
0069 text: "Item " + index
0070 }
0071 }
0072 }
0073 }
0074 }