Relative max/min drag
This commit is contained in:
parent
5c2a298160
commit
1e8fe109b4
1 changed files with 3 additions and 8 deletions
|
@ -53,12 +53,7 @@ Rectangle{
|
||||||
id: pointRectMouseArea
|
id: pointRectMouseArea
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
|
||||||
onPressed:{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
//pointRect.focus = true
|
|
||||||
if (mouse.button == Qt.RightButton){
|
if (mouse.button == Qt.RightButton){
|
||||||
pointRect.toggleType()
|
pointRect.toggleType()
|
||||||
dialog.show(pointRect)
|
dialog.show(pointRect)
|
||||||
|
@ -89,15 +84,15 @@ Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
drag.target: pointRect
|
drag.target: pointRect
|
||||||
drag.axis: Drag.XAxis
|
drag.axis: Drag.XAxis
|
||||||
drag.minimumX: -15 //TODO make relative
|
drag.minimumX: -1 * pointRect.width/2
|
||||||
drag.maximumX: 685 //TODO make relative!!
|
drag.maximumX: pointRect.parent.width - pointRect.width/2
|
||||||
drag.filterChildren: true //TODO testing this
|
drag.filterChildren: true //TODO testing this
|
||||||
//TODO make it impossible to overlap (on release)
|
//TODO make it impossible to overlap (on release)
|
||||||
|
//TODO drag to most right - jumps back, why?
|
||||||
|
|
||||||
states: State{
|
states: State{
|
||||||
id: "hidden"; when: pointRectMouseArea.drag.active
|
id: "hidden"; when: pointRectMouseArea.drag.active
|
||||||
PropertyChanges { target: pointRect; opacity: 0.5; }
|
PropertyChanges { target: pointRect; opacity: 0.5; }
|
||||||
//PropertyChanges { target: triggerTime; opacity: 0; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue