[vlmc-devel] Add Marker.qml

Yikai Lu git at videolan.org
Mon Jul 18 15:39:59 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Mon Jul 18 22:12:18 2016 +0900| [77a2806a66dc76c927bd9ee4db5642cffaf5a4f1] | committer: Yikai Lu

Add Marker.qml

> https://code.videolan.org/videolan/vlmc/commit/77a2806a66dc76c927bd9ee4db5642cffaf5a4f1
---

 src/Gui/timeline/Marker.qml             | 40 +++++++++++++++++++++++++++++++++
 src/Gui/timeline/resources-timeline.qrc |  1 +
 2 files changed, 41 insertions(+)

diff --git a/src/Gui/timeline/Marker.qml b/src/Gui/timeline/Marker.qml
new file mode 100644
index 0000000..443c0ce
--- /dev/null
+++ b/src/Gui/timeline/Marker.qml
@@ -0,0 +1,40 @@
+import QtQuick 2.0
+
+Rectangle {
+    id: marker
+
+    width: 1
+    height: page.height
+    color: "#3F6644"
+    x: ftop( position ) + initPosOfCursor
+
+    property int position: 0
+    property var markerModel
+
+    onPositionChanged: {
+        markerModel["position"] = position;
+        length = Math.max( length, position + 100 );
+    }
+
+    onMarkerModelChanged: {
+        position = markerModel["position"];
+    }
+
+    Drag.keys: ["Marker"]
+    Drag.active: markerMouseArea.drag.active
+    Rectangle {
+        x: - ( width - 1 ) / 2
+        width: 5
+        height: 9
+        color: "#63ff44"
+
+        MouseArea {
+            id: markerMouseArea
+            anchors.fill: parent
+            drag.target: marker
+            drag.axis: Drag.XAxis
+            drag.minimumX: 0
+        }
+    }
+}
+
diff --git a/src/Gui/timeline/resources-timeline.qrc b/src/Gui/timeline/resources-timeline.qrc
index 70470fc..6cfaf4f 100644
--- a/src/Gui/timeline/resources-timeline.qrc
+++ b/src/Gui/timeline/resources-timeline.qrc
@@ -4,6 +4,7 @@
         <file>Ruler.qml</file>
         <file>Track.qml</file>
         <file>TrackContainer.qml</file>
+        <file>Marker.qml</file>
         <file>Cursor.qml</file>
         <file>Clip.qml</file>
         <file>ClipContextMenu.qml</file>



More information about the Vlmc-devel mailing list