ref #86 "added mouse area for default qml control"

This commit is contained in:
Andrei Yankovich 2021-07-10 16:23:59 +03:00
parent 1065198edf
commit eeb757fd8e
2 changed files with 63 additions and 43 deletions

View File

@ -8,8 +8,13 @@
import QtQuick 2.15
import QtQuick.Controls.Material 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
AbstractMenuView {
columns: 2
rows: 2
Button {
text: qsTr("Back to menu.")
onClicked: {
@ -18,4 +23,21 @@ AbstractMenuView {
}
}
}
MouseArea {
property bool track: false
property real oldX: 0
property real oldY: 0
cursorShape: Qt.DragMoveCursor
Layout.fillHeight: true
Layout.fillWidth: true
Layout.columnSpan: 2
Layout.rowSpan: 2
onClicked: {
model.userTap()
}
}
}

View File

@ -8,25 +8,19 @@ DefaultMenu {
columns: 2
rows: 2
Button {
text: "🌀"
Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.columnSpan: 2
Layout.rowSpan: 2
onClicked: {
model.userTap()
}
}
color: "#22000000"
MouseArea {
property bool track: false
property real oldX: 0
property real oldY: 0
cursorShape: Qt.DragMoveCursor
Layout.fillHeight: true
Layout.fillWidth: true
Layout.columnSpan: 2
Layout.rowSpan: 2
onPressed: {
track = true
oldX = mouse.x
@ -69,6 +63,10 @@ DefaultMenu {
model.yChanged(radianDelta)
oldY = mouse.y;
}
anchors.fill: parent
}
}
}