diff --git a/src/monitor/view/OverlayCenter.qml b/src/monitor/view/OverlayCenter.qml new file mode 100644 index 000000000..e1c3341a1 --- /dev/null +++ b/src/monitor/view/OverlayCenter.qml @@ -0,0 +1,19 @@ +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.3 +import QtQuick 2.0 + +Item { + id: overlay + Rectangle { + color: root.overlayColor + width: parent.width + height: 1 + anchors.centerIn: parent + } + Rectangle { + color: root.overlayColor + height: parent.height + width: 1 + anchors.centerIn: parent + } +} diff --git a/src/monitor/view/OverlayCenterDiagonal.qml b/src/monitor/view/OverlayCenterDiagonal.qml new file mode 100644 index 000000000..ac4de2c74 --- /dev/null +++ b/src/monitor/view/OverlayCenterDiagonal.qml @@ -0,0 +1,33 @@ +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.3 +import QtQuick 2.0 + +Item { + id: overlay + property double diagonalLenght: Math.sqrt(Math.pow(parent.height, 2) + Math.pow(parent.width, 2)) + + function degreesRotation(width, height) { + var a = height/width; + var b = Math.sqrt(1 + Math.pow(a, 2)); + var angle = Math.acos(Math.pow(a,2) / (a * b)); + return angle * (180 / Math.PI); + } + + Rectangle { + color: root.overlayColor + width: overlay.diagonalLenght + height: 1 + rotation: degreesRotation(parent.height, parent.width) + anchors.centerIn: parent + antialiasing: true + } + + Rectangle { + color: root.overlayColor + height: overlay.diagonalLenght + width: 1 + rotation: degreesRotation(parent.width, parent.height) + anchors.centerIn: parent + antialiasing: true + } +} diff --git a/src/monitor/view/OverlayThirds.qml b/src/monitor/view/OverlayThirds.qml new file mode 100644 index 000000000..7a928ca67 --- /dev/null +++ b/src/monitor/view/OverlayThirds.qml @@ -0,0 +1,33 @@ +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.3 +import QtQuick 2.0 + +Item { + id: overlay + // Vertical segments + Rectangle { + color: root.overlayColor + height: parent.height + width: 1 + x: parent.width / 3 + } + Rectangle { + color: root.overlayColor + height: parent.height + width: 1 + x: (parent.width / 3 ) * 2 + } + // Horizontal segments + Rectangle { + color: root.overlayColor + width: parent.width + height: 1 + y: parent.height / 3 + } + Rectangle { + color: root.overlayColor + width: parent.width + height: 1 + y: (parent.height / 3) * 2 + } +} diff --git a/src/monitor/view/kdenliveclipmonitor.qml b/src/monitor/view/kdenliveclipmonitor.qml index 3a24b69db..c4054c32f 100644 --- a/src/monitor/view/kdenliveclipmonitor.qml +++ b/src/monitor/view/kdenliveclipmonitor.qml @@ -1,209 +1,218 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Window 2.2 import Kdenlive.Controls 1.0 import QtQuick 2.6 import AudioThumb 1.0 Item { id: root objectName: "root" SystemPalette { id: activePalette } // default size, but scalable by user height: 300; width: 400 property string markerText property point profile property double zoom property double scalex property double scaley property bool dropped property string fps property bool showMarkers property bool showTimecode property bool showFps property bool showSafezone property bool showAudiothumb property bool showToolbar: false property real baseUnit: fontMetrics.font.pixelSize * 0.8 property int duration: 300 property int mouseRulerPos: 0 property double frameSize: 10 property double timeScale: 1 property int overlayType: controller.overlayType property color overlayColor: 'cyan' property bool isClipMonitor: true FontMetrics { id: fontMetrics font.family: "Arial" } signal editCurrentMarker() signal toolBarChanged(bool doAccept) onDurationChanged: { clipMonitorRuler.updateRuler() } onWidthChanged: { clipMonitorRuler.updateRuler() } function switchOverlay() { - if (controller.overlayType >= 2) { + if (controller.overlayType >= 5) { controller.overlayType = 0 } else { controller.overlayType = controller.overlayType + 1; } root.overlayType = controller.overlayType } MouseArea { id: barOverArea hoverEnabled: true acceptedButtons: Qt.NoButton anchors.fill: parent } SceneToolBar { id: sceneToolBar anchors { right: parent.right top: parent.top topMargin: 4 rightMargin: 4 } visible: barOverArea.mouseX >= x - 10 } Item { height: root.height - controller.rulerHeight width: root.width Item { id: frame objectName: "referenceframe" width: root.profile.x * root.scalex height: root.profile.y * root.scaley anchors.centerIn: parent Loader { anchors.fill: parent source: { switch(root.overlayType) { case 0: { return ''; } case 1: { return "OverlayStandard.qml"; } case 2:{ return "OverlayMinimal.qml"; } + case 3:{ + return "OverlayCenter.qml"; + } + case 4:{ + return "OverlayCenterDiagonal.qml"; + } + case 5:{ + return "OverlayThirds.qml"; + } } } } } Item { id: monitorOverlay anchors.fill: parent QmlAudioThumb { id: audioThumb objectName: "audiothumb" property bool stateVisible: true anchors { left: parent.left bottom: parent.bottom } height: parent.height / 6 //font.pixelSize * 3 width: parent.width visible: root.showAudiothumb MouseArea { id: mouseOverArea hoverEnabled: true onExited: audioThumb.stateVisible = false onEntered: audioThumb.stateVisible = true acceptedButtons: Qt.NoButton anchors.fill: parent } states: [ State { when: audioThumb.stateVisible; PropertyChanges { target: audioThumb; opacity: 1.0 } }, State { when: !audioThumb.stateVisible; PropertyChanges { target: audioThumb; opacity: 0.0 } } ] transitions: [ Transition { NumberAnimation { property: "opacity"; duration: 500} } ] } Text { id: timecode objectName: "timecode" color: "white" style: Text.Outline; styleColor: "black" text: controller.toTimecode(controller.position) font.pixelSize: root.baseUnit visible: root.showTimecode anchors { right: parent.right bottom: parent.bottom rightMargin: 4 } } Text { id: fpsdropped objectName: "fpsdropped" color: root.dropped ? "red" : "white" style: Text.Outline; styleColor: "black" text: root.fps + "fps" visible: root.showFps font.pixelSize: root.baseUnit anchors { right: timecode.visible ? timecode.left : parent.right bottom: parent.bottom rightMargin: 10 } } TextField { id: marker objectName: "markertext" activeFocusOnPress: true onEditingFinished: { root.markerText = marker.displayText marker.focus = false root.editCurrentMarker() } anchors { left: parent.left bottom: parent.bottom } visible: root.showMarkers && text != "" text: controller.markerComment maximumLength: 20 style: TextFieldStyle { textColor: "white" background: Rectangle { color: controller.position == controller.zoneIn ? "#9900ff00" : controller.position == controller.zoneOut ? "#99ff0000" : "#990000ff" width: marker.width } } font.pixelSize: root.baseUnit } } } MonitorRuler { id: clipMonitorRuler anchors { left: root.left right: root.right bottom: root.bottom } height: controller.rulerHeight } } diff --git a/src/monitor/view/kdenlivemonitor.qml b/src/monitor/view/kdenlivemonitor.qml index 37f39db0d..6be9f6a6e 100644 --- a/src/monitor/view/kdenlivemonitor.qml +++ b/src/monitor/view/kdenlivemonitor.qml @@ -1,176 +1,185 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Window 2.2 import Kdenlive.Controls 1.0 import QtQuick 2.4 import AudioThumb 1.0 Item { id: root objectName: "root" SystemPalette { id: activePalette } // default size, but scalable by user height: 300; width: 400 property string markerText property point profile property double zoom property double scalex property double scaley property bool dropped property string fps property bool showMarkers property bool showTimecode property bool showFps property bool showSafezone property bool showAudiothumb property real baseUnit: fontMetrics.font.pixelSize * 0.8 property int duration: 300 property int mouseRulerPos: 0 property double frameSize: 10 property double timeScale: 1 property int overlayType: controller.overlayType property color overlayColor: 'cyan' property bool isClipMonitor: false FontMetrics { id: fontMetrics font.family: "Arial" } signal editCurrentMarker() signal toolBarChanged(bool doAccept) onDurationChanged: { clipMonitorRuler.updateRuler() } onWidthChanged: { clipMonitorRuler.updateRuler() } function switchOverlay() { - if (controller.overlayType >= 2) { + if (controller.overlayType >= 5) { controller.overlayType = 0 } else { controller.overlayType = controller.overlayType + 1; } root.overlayType = controller.overlayType } MouseArea { id: barOverArea hoverEnabled: true acceptedButtons: Qt.NoButton anchors.fill: parent } SceneToolBar { id: sceneToolBar anchors { right: parent.right top: parent.top topMargin: 4 rightMargin: 4 } visible: barOverArea.mouseX >= x - 10 } Item { height: root.height - controller.rulerHeight width: root.width Item { id: frame objectName: "referenceframe" width: root.profile.x * root.scalex height: root.profile.y * root.scaley anchors.centerIn: parent Loader { anchors.fill: parent source: { switch(root.overlayType) { case 0: { return ''; } case 1: { return "OverlayStandard.qml"; } case 2:{ return "OverlayMinimal.qml"; } + case 3:{ + return "OverlayCenter.qml"; + } + case 4:{ + return "OverlayCenterDiagonal.qml"; + } + case 5:{ + return "OverlayThirds.qml"; + } } } } } Item { id: monitorOverlay anchors.fill: parent Text { id: timecode objectName: "timecode" color: "white" style: Text.Outline; styleColor: "black" text: controller.toTimecode(controller.position) font.pixelSize: root.baseUnit visible: root.showTimecode anchors { right: parent.right bottom: parent.bottom rightMargin: 4 } } Text { id: fpsdropped objectName: "fpsdropped" color: root.dropped ? "red" : "white" style: Text.Outline; styleColor: "black" text: root.fps + "fps" visible: root.showFps font.pixelSize: root.baseUnit anchors { right: timecode.visible ? timecode.left : parent.right bottom: parent.bottom rightMargin: 10 } } TextField { id: marker objectName: "markertext" activeFocusOnPress: true onEditingFinished: { root.markerText = marker.displayText marker.focus = false root.editCurrentMarker() } anchors { left: parent.left bottom: parent.bottom } visible: root.showMarkers && text != "" text: controller.markerComment maximumLength: 20 style: TextFieldStyle { textColor: "white" background: Rectangle { color: controller.position == controller.zoneIn ? "#9900ff00" : controller.position == controller.zoneOut ? "#99ff0000" : "#990000ff" width: marker.width } } font.pixelSize: root.baseUnit } } } MonitorRuler { id: clipMonitorRuler anchors { left: root.left right: root.right bottom: root.bottom } height: controller.rulerHeight } } diff --git a/src/uiresources.qrc b/src/uiresources.qrc index 2163ee3cd..fc42c94be 100644 --- a/src/uiresources.qrc +++ b/src/uiresources.qrc @@ -1,46 +1,49 @@ kdenliveui.rc monitor/view/kdenlivemonitor.qml monitor/view/kdenliveclipmonitor.qml monitor/view/kdenlivemonitoreffectscene.qml monitor/view/kdenlivemonitorcornerscene.qml monitor/view/kdenlivemonitorrotoscene.qml monitor/view/kdenlivemonitorsplit.qml monitor/view/kdenlivemonitorripple.qml monitor/view/SceneToolBar.qml monitor/view/EffectToolBar.qml monitor/view/MonitorRuler.qml monitor/view/OverlayStandard.qml monitor/view/OverlayMinimal.qml + monitor/view/OverlayCenter.qml + monitor/view/OverlayCenterDiagonal.qml + monitor/view/OverlayThirds.qml timeline2/view/qml/timeline.qml timeline2/view/qml/TrackHead.qml timeline2/view/qml/Track.qml timeline2/view/qml/Ruler.qml timeline2/view/qml/Clip.qml timeline2/view/qml/KeyframeView.qml timeline2/view/qml/Composition.qml timeline2/view/qml/ClipMenu.qml timeline2/view/qml/CompositionMenu.qml timeline2/view/qml/PulsingAnimation.qml timeline2/view/qml/CornerSelectionShadow.qml timeline2/view/qml/Timeline.js assets/assetlist/view/qml/assetList.qml assets/view/qml/AssetView.qml transitions/view/qml/transitionView.qml timeline2/view/qml/AssetMenu.qml effects/effectstack/view/qml/BuiltStack.qml effects/effectstack/view/qml/EffectSlider.qml effects/effectstack/view/qml/LiftGammaGain.qml ../data/blacklisted_effects.txt ../data/blacklisted_transitions.txt ../data/kdenlive_renderprofiles.knsrc ../data/kdenlive_titles.knsrc ../data/kdenlive_wipes.knsrc ../data/kdenlive_keyboardschemes.knsrc