Skip to content

Commit

Permalink
Use MouseArea instead of TapHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
iiLubos committed Oct 4, 2023
1 parent 4cb3aca commit f7764d6
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 36 deletions.
16 changes: 10 additions & 6 deletions app/qml/NumberSpin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ Item {
width: imageDecrease.width * 3
height: imageDecrease.height * 3

TapHandler {
onTapped: function(eventPoint, button) {
if (minValue <= root.value - 1) root.value -=1
MouseArea {
anchors.fill: parent

onClicked: {
if (minValue <= root.value - 1) root.value -=1
}
}
}
Expand All @@ -86,9 +88,11 @@ Item {
width: imageIncrease.width * 3
height: imageIncrease.height * 3

TapHandler {
onTapped: function(eventPoint, button) {
if (maxValue >= root.value + 1) root.value +=1
MouseArea {
anchors.fill: parent

onClicked: {
if (maxValue >= root.value + 1) root.value +=1
}
}
}
Expand Down
24 changes: 16 additions & 8 deletions app/qml/SettingsPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ Item {
onCheckedChanged: __appSettings.autoCenterMapChecked = checked
}

TapHandler {
onTapped: function(eventPoint, button) {
MouseArea {
anchors.fill: parent

onClicked: {
autoCenterMapSwitch.toggle()
}
}
Expand Down Expand Up @@ -217,8 +219,10 @@ Item {
onCheckedChanged: __appSettings.gpsAccuracyWarning = checked
}

TapHandler {
onTapped: function(eventPoint, button) {
MouseArea {
anchors.fill: parent

onClicked: {
accuracyWarningSwitch.toggle()
}
}
Expand Down Expand Up @@ -300,8 +304,10 @@ Item {
onCheckedChanged: __appSettings.reuseLastEnteredValues = checked
}

TapHandler {
onTapped: function(eventPoint, button) {
MouseArea {
anchors.fill: parent

onClicked: {
rememberValuesSwitch.toggle()
}
}
Expand All @@ -320,8 +326,10 @@ Item {
onCheckedChanged: __appSettings.autosyncAllowed = checked
}

TapHandler {
onTapped: function(eventPoint, button) {
MouseArea {
anchors.fill: parent

onClicked: {
autosyncSwitch.toggle()
}
}
Expand Down
16 changes: 9 additions & 7 deletions app/qml/components/MainPanelButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ Rectangle {
anchors.fill: parent
enabled: root.enabled && handleClicks

TapHandler {
onTapped: function(eventPoint, button) {
root.activated()
}
MouseArea {
anchors.fill: parent

onLongPressed: {
root.activatedOnHold()
}
onClicked: {
root.activated()
}

onPressAndHold: {
root.activatedOnHold()
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions app/qml/components/MapFloatButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ Item {
Item {
anchors.fill: parent

TapHandler {
onTapped: function(eventPoint, button) {
MouseArea {
anchors.fill: parent

onClicked: {
root.clicked()
}

onLongPressed: function() {
onPressAndHold: {
root.pressAndHold()
}
}
Expand Down
26 changes: 14 additions & 12 deletions app/qml/editor/AbstractEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ Item {
x: leftActionContainer.actionAllowed ? parent.x - customStyle.fields.sideMargin : parent.x
height: parent.height

TapHandler {
onPressedChanged: {
if ( !pressed ) {
root.leftActionClicked()
}
MouseArea {
anchors.fill: parent

onReleased: {
root.leftActionClicked()
}
}
}
Expand All @@ -79,8 +79,10 @@ Item {
height: parent.height
width: parent.width - ( leftActionContainer.width + rightActionContainer.width )

TapHandler {
onSingleTapped: {
MouseArea {
anchors.fill: parent

onClicked: {
root.contentClicked()
}
}
Expand All @@ -101,11 +103,11 @@ Item {
width: rightActionContainer.actionAllowed ? parent.width + customStyle.fields.sideMargin : parent.width
height: parent.height

TapHandler {
onPressedChanged: {
if ( !pressed ) {
root.rightActionClicked()
}
MouseArea {
anchors.fill: parent

onReleased: {
root.rightActionClicked()
}
}
}
Expand Down

1 comment on commit f7764d6

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 23.10.462811 just submitted!

Please sign in to comment.