Warning, /pim/kube/framework/qml/ScrollablePopup.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  Copyright (C) 2022 Christian Mollekopf, <christian@mkpf.ch>
0003  *
0004  *  This program is free software; you can redistribute it and/or modify
0005  *  it under the terms of the GNU General Public License as published by
0006  *  the Free Software Foundation; either version 2 of the License, or
0007  *  (at your option) any later version.
0008  *
0009  *  This program is distributed in the hope that it will be useful,
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012  *  GNU General Public License for more details.
0013  *
0014  *  You should have received a copy of the GNU General Public License along
0015  *  with this program; if not, write to the Free Software Foundation, Inc.,
0016  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0017  */
0018 
0019 
0020 import QtQuick 2.9
0021 import QtQuick.Controls 2
0022 import QtQuick.Layouts 1.1
0023 
0024 import org.kube.framework 1.0 as Kube
0025 
0026 Kube.Popup {
0027     id: root
0028     modal: true
0029     parent: ApplicationWindow.overlay
0030     closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
0031     x: (parent.width - width)/2
0032     y: Kube.Units.largeSpacing
0033     width: parent.width / 2
0034     height: parent.height - Kube.Units.largeSpacing * 2
0035     clip: true
0036 
0037     default property alias data: flickable.data
0038 
0039     signal accepted
0040 
0041     ColumnLayout {
0042         anchors.fill: parent
0043 
0044         Flickable {
0045             id: flickable
0046             Layout.fillWidth: true
0047             Layout.fillHeight: true
0048             ScrollBar.vertical: Kube.ScrollBar {}
0049             contentHeight: grid.height
0050             contentWidth: parent.width
0051 
0052             Keys.onReturnPressed: {
0053                 root.accepted()
0054             }
0055         }
0056 
0057         Kube.ScrollHelper {
0058             id: scrollHelper
0059             flickable: flickable
0060             anchors.fill: parent
0061         }
0062 
0063         Row {
0064             id: footer
0065             Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
0066             height: Kube.Units.gridUnit
0067             spacing: Kube.Units.smallSpacing
0068 
0069             Kube.Button {
0070                 text: qsTr("Discard")
0071                 onClicked: root.close()
0072             }
0073 
0074             Kube.Button {
0075                 text: qsTr("Save")
0076                 onClicked: root.accepted()
0077             }
0078         }
0079     }
0080 }