mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 13:15:57 +08:00
Make expandable component dragable.
This commit is contained in:
parent
46403a0fde
commit
28a14c0a3b
@ -225,6 +225,33 @@ Item
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: dragRegion
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: contentHeader.xPosCloseButton
|
||||
}
|
||||
property variant clickPos: Qt.point(0, 0)
|
||||
|
||||
onPressed:
|
||||
{
|
||||
clickPos = Qt.point(mouse.x, mouse.y);
|
||||
}
|
||||
|
||||
onPositionChanged:
|
||||
{
|
||||
var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y);
|
||||
if (delta.x != 0 || delta.y != 0)
|
||||
{
|
||||
contentContainer.x += delta.x;
|
||||
contentContainer.y += delta.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Control
|
||||
|
@ -13,6 +13,7 @@ Cura.RoundedRectangle
|
||||
id: header
|
||||
|
||||
property alias headerTitle: headerLabel.text
|
||||
property alias xPosCloseButton: closeButton.left
|
||||
|
||||
height: UM.Theme.getSize("expandable_component_content_header").height
|
||||
color: UM.Theme.getColor("secondary")
|
||||
|
Loading…
x
Reference in New Issue
Block a user