Skip to content
Snippets Groups Projects
Commit f1685cb2 authored by luyikei's avatar luyikei
Browse files

Cursor.qml: Add a triangle to the top of the cursor

parent ebf408ea
No related branches found
No related tags found
No related merge requests found
import QtQuick 2.0
import QtQuick 2.5
Rectangle {
width: 2
width: 1
color: "#c24a00"
x: ftop( cursorPosition ) + initPosOfCursor
......@@ -10,8 +10,25 @@ Rectangle {
x = Qt.binding( function() { return ftop( cursorPosition ) + initPosOfCursor; } );
}
function position() {
return ptof( x - initPosOfCursor );
// Triangle
Canvas {
id: mycanvas
width: 15
height: width / 2 * 1.73
y: - height
x: - width / 2
onPaint: {
var ctx = getContext( "2d" );
ctx.fillStyle = Qt.rgba( 0.9, 0.8, 0.25, 1 );
ctx.strokeStyle = "transparent";
ctx.beginPath();
ctx.moveTo( 0, 0 );
ctx.lineTo( width, 0 );
ctx.lineTo( width / 2, height );
ctx.closePath();
ctx.fill();
ctx.stroke();
}
}
}
......@@ -321,6 +321,7 @@ Rectangle {
Cursor {
id: cursor
y: ruler.height
z: 2000
height: page.height
x: initPosOfCursor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment