mirror of
https://github.com/monero-project/monero-gui
synced 2025-01-02 21:26:24 +01:00
Make dialogs draggable
This commit is contained in:
parent
4ca35af11a
commit
8cd6f3f5b6
@ -59,6 +59,15 @@ Window {
|
|||||||
width: 480
|
width: 480
|
||||||
height: 280
|
height: 280
|
||||||
|
|
||||||
|
// Make window draggable
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
property point lastMousePos: Qt.point(0, 0)
|
||||||
|
onPressed: { lastMousePos = Qt.point(mouseX, mouseY); }
|
||||||
|
onMouseXChanged: root.x += (mouseX - lastMousePos.x)
|
||||||
|
onMouseYChanged: root.y += (mouseY - lastMousePos.y)
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: mainLayout
|
id: mainLayout
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
@ -53,6 +53,15 @@ Window {
|
|||||||
width: 480
|
width: 480
|
||||||
height: 200
|
height: 200
|
||||||
|
|
||||||
|
// Make window draggable
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
property point lastMousePos: Qt.point(0, 0)
|
||||||
|
onPressed: { lastMousePos = Qt.point(mouseX, mouseY); }
|
||||||
|
onMouseXChanged: root.x += (mouseX - lastMousePos.x)
|
||||||
|
onMouseYChanged: root.y += (mouseY - lastMousePos.y)
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: mainLayout
|
id: mainLayout
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
@ -56,6 +56,15 @@ Window {
|
|||||||
width: 480
|
width: 480
|
||||||
height: walletName ? 240 : 200
|
height: walletName ? 240 : 200
|
||||||
|
|
||||||
|
// Make window draggable
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
property point lastMousePos: Qt.point(0, 0)
|
||||||
|
onPressed: { lastMousePos = Qt.point(mouseX, mouseY); }
|
||||||
|
onMouseXChanged: root.x += (mouseX - lastMousePos.x)
|
||||||
|
onMouseYChanged: root.y += (mouseY - lastMousePos.y)
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: mainLayout
|
id: mainLayout
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
@ -54,6 +54,14 @@ Window {
|
|||||||
signal accepted()
|
signal accepted()
|
||||||
signal rejected()
|
signal rejected()
|
||||||
|
|
||||||
|
// Make window draggable
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
property point lastMousePos: Qt.point(0, 0)
|
||||||
|
onPressed: { lastMousePos = Qt.point(mouseX, mouseY); }
|
||||||
|
onMouseXChanged: root.x += (mouseX - lastMousePos.x)
|
||||||
|
onMouseYChanged: root.y += (mouseY - lastMousePos.y)
|
||||||
|
}
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
show()
|
show()
|
||||||
|
Loading…
Reference in New Issue
Block a user