Warning, /multimedia/kid3/src/qml/app/FileCollapsible.qml is written in an unsupported language. File is not indexed.

0001 /**
0002  * \file FileCollapsible.qml
0003  * Collapsible with file information.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 16 Feb 2015
0008  *
0009  * Copyright (C) 2015-2018  Urs Fleisch
0010  *
0011  * This program is free software; you can redistribute it and/or modify
0012  * it under the terms of the GNU Lesser General Public License as published by
0013  * the Free Software Foundation; version 3.
0014  *
0015  * This program is distributed in the hope that it will be useful,
0016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0018  * GNU Lesser General Public License for more details.
0019  *
0020  * You should have received a copy of the GNU Lesser General Public License
0021  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0022  */
0023 
0024 import QtQuick 2.11
0025 import QtQuick.Controls 2.4
0026 
0027 Collapsible {
0028   id: fileCollapsible
0029 
0030   property alias fileName: fileNameEdit.text
0031 
0032   text: qsTr("File") + ": " + app.selectionInfo.detailInfo
0033   checked: true
0034 
0035   content: Item {
0036     width: parent.width
0037     height: fileNameEdit.height + constants.gu(2)
0038     Item {
0039       id: fileNameModifiedImage
0040       anchors.left: parent.left
0041       anchors.verticalCenter: parent.verticalCenter
0042       width: constants.gu(2)
0043       height: constants.gu(2)
0044       Text {
0045         font.family: materialFont.name
0046         font.pixelSize: 16
0047         text: "M"
0048         color: fileNameLabel.color
0049         visible: app.selectionInfo.fileNameChanged
0050       }
0051     }
0052     Label {
0053       id: fileNameLabel
0054       anchors.left: fileNameModifiedImage.right
0055       anchors.verticalCenter: parent.verticalCenter
0056       text: "Name:"
0057     }
0058     TextField {
0059       id: fileNameEdit
0060       anchors.left: fileNameLabel.right
0061       anchors.right: parent.right
0062       anchors.verticalCenter: parent.verticalCenter
0063       anchors.margins: constants.margins
0064       text: app.selectionInfo.fileName
0065       selectByMouse: true
0066       focus: true
0067       onAccepted: {
0068         focus = false
0069       }
0070       onActiveFocusChanged: {
0071         if (!activeFocus) {
0072           app.selectionInfo.fileName = text
0073         }
0074       }
0075     }
0076   }
0077 }