Warning, /utilities/krecorder/src/contents/ui/RecordingListDelegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2020 Jonah BrĂ¼chert <jbb@kaidan.im>
0003  * SPDX-FileCopyrightText: 2020-2021 Devin Lin <espidev@gmail.com>
0004  *
0005  * SPDX-License-Identifier: GPL-3.0-or-later
0006  */
0007 
0008 import QtQuick
0009 import QtQuick.Controls as Controls
0010 import QtQuick.Layouts
0011 
0012 import org.kde.kirigami as Kirigami
0013 
0014 import KRecorder
0015 
0016 import "components"
0017 
0018 ListDelegate {
0019     id: root
0020     
0021     property Recording recording
0022     property bool editMode: false
0023     
0024     signal contextMenuRequested()
0025     signal editRequested()
0026     signal deleteRequested()
0027     signal exportRequested()
0028     
0029     leftPadding: Kirigami.Units.largeSpacing * 2
0030     rightPadding: Kirigami.Units.largeSpacing * 2
0031     topPadding: Kirigami.Units.largeSpacing
0032     bottomPadding: Kirigami.Units.largeSpacing
0033     
0034     onClicked: applicationWindow().switchToRecording(recording)
0035     onRightClicked: root.contextMenuRequested()
0036     
0037     contentItem: RowLayout {
0038         spacing: 0
0039         
0040         ColumnLayout {
0041             Layout.fillWidth: true
0042             Layout.fillHeight: true
0043             spacing: Kirigami.Units.smallSpacing
0044             
0045             Controls.Label {
0046                 Layout.topMargin: Kirigami.Units.smallSpacing
0047                 Layout.fillWidth: true
0048                 font.pointSize: Math.round(Kirigami.Theme.defaultFont.pointSize * 1.1)
0049                 font.weight: Font.Medium
0050                 text: recording.fileName
0051                 wrapMode: Text.Wrap
0052                 color: (applicationWindow().isWidescreen && applicationWindow().currentRecording && applicationWindow().currentRecording.filePath === recording.filePath) ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor 
0053             }
0054             
0055             RowLayout {
0056                 Layout.bottomMargin: Kirigami.Units.smallSpacing
0057                 Controls.Label {
0058                     color: Kirigami.Theme.disabledTextColor
0059                     text: recording.recordDate
0060                 }
0061                 
0062                 Item { Layout.fillWidth: true }
0063                 
0064                 Controls.Label {
0065                     visible: !root.editMode // don't show right aligned text when actions are shown
0066                     color: Kirigami.Theme.disabledTextColor
0067                     text: recording.recordingLength
0068                 }
0069             }
0070         }
0071         
0072         ToolTipToolButton {
0073             Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
0074             icon.name: "document-save"
0075             text: i18n("Export to location")
0076             onClicked: root.exportRequested()
0077             visible: root.editMode
0078         }
0079         
0080         ToolTipToolButton {
0081             Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
0082             icon.name: "entry-edit"
0083             text: i18n("Rename")
0084             onClicked: root.editRequested()
0085             visible: root.editMode
0086         }
0087         
0088         ToolTipToolButton {
0089             Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
0090             icon.name: "delete"
0091             text: i18n("Delete")
0092             onClicked: root.deleteRequested()
0093             visible: root.editMode
0094         }
0095     }
0096 }