mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Make expandable component dragable.
This commit is contained in:
parent
46403a0fde
commit
28a14c0a3b
2 changed files with 28 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue