Warning, /network/angelfish/src/contents/ui/InputSheet.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2019 Jonah BrĂ¼chert
0002 // SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
0003 //
0004 // SPDX-License-Identifier: GPL-2.0-or-later
0005 
0006 import QtQuick.Controls 2.1 as Controls
0007 import QtQuick.Layouts 1.7
0008 import QtQuick 2.7
0009 
0010 import org.kde.kirigami 2.20 as Kirigami
0011 
0012 Kirigami.PromptDialog {
0013     id: root
0014     property string placeholderText
0015     property string description
0016     property string text
0017 
0018     standardButtons: Kirigami.Dialog.Ok
0019 
0020     onAccepted: root.text = textField.text
0021 
0022     ColumnLayout {
0023         Controls.Label {
0024             Layout.fillWidth: true
0025             text: root.description
0026             wrapMode: Text.WordWrap
0027         }
0028 
0029         Controls.TextField {
0030             id: textField
0031             Layout.fillWidth: true
0032             placeholderText: root.placeholderText
0033             text: root.text
0034             focus: true
0035             onAccepted: accept()
0036         }
0037     }
0038 
0039     onVisibleChanged: {
0040         if (visible) {
0041             textField.forceActiveFocus()
0042         }
0043     }
0044 }