Warning, /multimedia/kdenlive/src/monitor/view/kdenlivemonitortrimming.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2021 Julius Künzel <jk.kdedev@smartlab.uber.space>
0003     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 import QtQuick.Controls 2.15
0007 import QtQuick.Window 2.15
0008 import Kdenlive.Controls 1.0
0009 import QtQuick 2.15
0010 
0011 Item {
0012     id: root
0013     objectName: "root"
0014 
0015     SystemPalette { id: activePalette }
0016 
0017     // default size, but scalable by user
0018     height: 300; width: 400
0019     property string markerText
0020     property point profile: controller.profile
0021     property double zoom
0022     property double scalex
0023     property double scaley
0024     property bool captureRightClick: false
0025     property bool dropped: false
0026     property string fps: '-'
0027     property bool showMarkers: false
0028     property bool showTimecode: false
0029     property bool showFps: false
0030     property bool showSafezone: false
0031     property bool showAudiothumb: false
0032     // Zoombar properties
0033     property double zoomStart: 0
0034     property double zoomFactor: 1
0035     property int zoomOffset: 0
0036     property bool showZoomBar: false
0037     property real baseUnit: fontMetrics.font.pixelSize * 0.8
0038     property int duration: 300
0039     property int mouseRulerPos: 0
0040     property double frameSize: 10
0041     property double timeScale: 1
0042     property int overlayType: controller.overlayType
0043     property color overlayColor: controller.overlayColor
0044     property bool isClipMonitor: false
0045 
0046     function updateClickCapture() {
0047         root.captureRightClick = false
0048     }
0049 
0050     FontMetrics {
0051         id: fontMetrics
0052         font: fixedFont
0053     }
0054 
0055     signal editCurrentMarker()
0056 
0057     function switchOverlay() {
0058         if (controller.overlayType >= 5) {
0059             controller.overlayType = 0
0060         } else {
0061             controller.overlayType = controller.overlayType + 1;
0062         }
0063         root.overlayType = controller.overlayType
0064     }
0065     MouseArea {
0066         id: barOverArea
0067         hoverEnabled: true
0068         acceptedButtons: Qt.NoButton
0069         anchors.fill: parent
0070         onWheel: wheel => {
0071             controller.seek(wheel.angleDelta.x + wheel.angleDelta.y, wheel.modifiers)
0072         }
0073         /*onEntered: {
0074             controller.setWidgetKeyBinding(i18n("TODO: This is the wonderful new trimming monitor overlay!"));
0075         }*/
0076         onExited: {
0077             controller.setWidgetKeyBinding();
0078         }
0079     }
0080     SceneToolBar {
0081         id: sceneToolBar
0082         anchors {
0083             right: parent.right
0084             top: parent.top
0085             topMargin: 4
0086             rightMargin: 4
0087             leftMargin: 4
0088         }
0089     }
0090 
0091     Item {
0092         height: root.height - controller.rulerHeight
0093         width: root.width
0094         Item {
0095             id: frame
0096             objectName: "referenceframe"
0097             width: root.profile.x * root.scalex
0098             height: root.profile.y * root.scaley
0099             anchors.centerIn: parent
0100             Rectangle {
0101                 width: parent.width / 2
0102                 height: parent.height / 2
0103                 x: 0
0104                 y: parent.height / 4
0105                 color: "transparent"
0106                 //border.color: "#ff0000"
0107                 //border.width: 2
0108                 Label {
0109                     text: i18n("In")
0110                     color: "#ffffff"
0111                     padding: 4
0112                     background: Rectangle {
0113                         color: "#990000"
0114                     }
0115                 }
0116                 Label {
0117                     id: trimmingTC1
0118                     font.family: fontMetrics.font.family
0119                     objectName: "trimmingTC1"
0120                     text: controller.trimmingTC1
0121                     color: "#ffffff"
0122                     padding: 4
0123                     background: Rectangle {
0124                         color: "black"
0125                         opacity: 0.5
0126                     }
0127                     anchors {
0128                         horizontalCenter: parent.horizontalCenter
0129                         bottom: parent.bottom
0130                         bottomMargin: 8
0131                     }
0132                 }
0133             }
0134             Rectangle {
0135                 width: parent.width / 2
0136                 height: parent.height / 2
0137                 x: parent.width / 2
0138                 y: parent.height / 4
0139                 color: "transparent"
0140                 //border.color: "#ff0000"
0141                 //border.width: 2
0142                 Label {
0143                     text: i18n("Out")
0144                     color: "#ffffff"
0145                     padding: 4
0146                     background: Rectangle {
0147                         color: "#990000"
0148                     }
0149                 }
0150                 Label {
0151                     id: trimmingTC2
0152                     font.family: fontMetrics.font.family
0153                     objectName: "trimmingTC2"
0154                     text: controller.trimmingTC2
0155                     color: "#ffffff"
0156                     padding: 4
0157                     background: Rectangle {
0158                         color: "black"
0159                         opacity: 0.5
0160                     }
0161                     anchors {
0162                         horizontalCenter: parent.horizontalCenter
0163                         bottom: parent.bottom
0164                         bottomMargin: 8
0165                     }
0166                 }
0167             }
0168         }
0169     }
0170 }