Warning, /graphics/koko/src/qml/ShareDrawer.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2021 Carl Schwan <carl@carlschwan.eu>
0002 // SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003 
0004 import QtQuick
0005 import QtQuick.Layouts
0006 import QtQuick.Controls as Controls
0007 import org.kde.purpose as Purpose
0008 import org.kde.kirigami as Kirigami
0009 import org.kde.kirigamiaddons.formcard 1 as FormCard
0010 
0011 Kirigami.OverlayDrawer {
0012     id: drawer
0013 
0014     required property var inputData
0015 
0016     height: popupContent.implicitHeight
0017     edge: Qt.BottomEdge
0018 
0019     leftPadding: 0
0020     rightPadding: 0
0021     bottomPadding: 0
0022     topPadding: 0
0023 
0024     property string title: i18n("Share the selected media")
0025 
0026     parent: applicationWindow().overlay
0027 
0028     ColumnLayout {
0029         id: popupContent
0030         width: parent.width
0031         spacing: 0
0032 
0033         Kirigami.ListSectionHeader {
0034             label: drawer.title
0035         }
0036 
0037         Repeater {
0038             id: listViewAction
0039             model: Purpose.PurposeAlternativesModel {
0040                 pluginType: "Export"
0041                 inputData: drawer.inputData
0042             }
0043 
0044             FormCard.FormButtonDelegate {
0045                 text: model.display
0046                 icon.name: model.iconName
0047                 onClicked: {
0048                     const dialog = applicationWindow().pageStack.pushDialogLayer('qrc:/qml/ShareDialog.qml', {
0049                         title: drawer.title,
0050                         index: index,
0051                         model: listViewAction.model
0052                     })
0053                     drawer.close()
0054                 }
0055             }
0056         }
0057     }
0058 }