HDrawer resizer: use MouseArea's pressed prop
This commit is contained in:
parent
0578844eef
commit
8c8ba221d3
|
@ -87,24 +87,21 @@ Drawer {
|
||||||
(horizontal ? Qt.SizeHorCursor : Qt.SizeVerCursor) :
|
(horizontal ? Qt.SizeHorCursor : Qt.SizeVerCursor) :
|
||||||
Qt.ArrowCursor
|
Qt.ArrowCursor
|
||||||
|
|
||||||
onPressed: canResize = true
|
|
||||||
onReleased: {canResize = false; userResized(drawer.preferredSize)}
|
|
||||||
|
|
||||||
onMouseXChanged:
|
onMouseXChanged:
|
||||||
if (horizontal && canResize) {
|
if (horizontal && pressed) {
|
||||||
drawer.preferredSize =
|
drawer.preferredSize =
|
||||||
drawer.calculatedSize +
|
drawer.calculatedSize +
|
||||||
(drawer.edge === Qt.RightEdge ? -mouseX : mouseX)
|
(drawer.edge === Qt.RightEdge ? -mouseX : mouseX)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMouseYChanged:
|
onMouseYChanged:
|
||||||
if (vertical && canResize) {
|
if (vertical && pressed) {
|
||||||
drawer.preferredSize =
|
drawer.preferredSize =
|
||||||
drawer.calculatedSize +
|
drawer.calculatedSize +
|
||||||
(drawer.edge === Qt.BottomEdge ? -mouseY : mouseY)
|
(drawer.edge === Qt.BottomEdge ? -mouseY : mouseY)
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool canResize: false
|
onReleased: userResized(drawer.preferredSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user