Commit c2dfacb8 authored by eekkelund's avatar eekkelund

[Header] Quick fix to make header work with Qt5.9

parent 64231caa
...@@ -183,7 +183,8 @@ Item { ...@@ -183,7 +183,8 @@ Item {
color: Theme.backgroundColor color: Theme.backgroundColor
FilteringMouseArea { //TODO: Check if changing this FilteringMouseArea->MouseArea has any side effects
MouseArea {
id: mouseArea id: mouseArea
anchors.fill: parent anchors.fill: parent
property bool swiping: false property bool swiping: false
...@@ -215,18 +216,18 @@ Item { ...@@ -215,18 +216,18 @@ Item {
} }
if (appWindow.isUiPortrait) { if (appWindow.isUiPortrait) {
startMouseCoord = (pos.y + root.y) startMouseCoord = (mouse.y + root.y)
startCoord = root.y startCoord = root.y
} else { //assuming that otherwise we're in landscape...is this safe? } else { //assuming that otherwise we're in landscape...is this safe?
startMouseCoord = (pos.x + root.x) startMouseCoord = (mouse.x + root.x)
startCoord = root.x startCoord = root.x
} }
} }
onPositionChanged: { onPositionChanged: {
if (appWindow.isUiPortrait) { if (appWindow.isUiPortrait) {
deltaCoord = (pos.y + root.y) - startMouseCoord deltaCoord = (mouse.y + root.y) - startMouseCoord
if (Math.abs(deltaCoord) > swipeThreshold && !swiping) { grabMouseEvents(); swiping = true; } if (Math.abs(deltaCoord) > swipeThreshold && !swiping) { swiping = true; }
if (swiping) { if (swiping) {
var swipingY = startCoord + deltaCoord var swipingY = startCoord + deltaCoord
...@@ -238,8 +239,8 @@ Item { ...@@ -238,8 +239,8 @@ Item {
} }
} }
} else { } else {
deltaCoord = (pos.x + root.x) - startMouseCoord deltaCoord = (mouse.x + root.x) - startMouseCoord
if (Math.abs(deltaCoord) > swipeThreshold && !swiping) { grabMouseEvents(); swiping = true; } if (Math.abs(deltaCoord) > swipeThreshold && !swiping) { swiping = true; }
if (swiping) { if (swiping) {
//this is the coord that the drawer would be at if it were following our finger //this is the coord that the drawer would be at if it were following our finger
var swipingX = startCoord + deltaCoord var swipingX = startCoord + deltaCoord
...@@ -285,7 +286,7 @@ Item { ...@@ -285,7 +286,7 @@ Item {
//Fully Close/Open the drawer //Fully Close/Open the drawer
root.slideDrawerTo((root.x == root.closedX) ? 0 : root.closedX) root.slideDrawerTo((root.x == root.closedX) ? 0 : root.closedX)
} else { } else {
deltaCoord = (pos.x + root.x) - startMouseCoord deltaCoord = (mouse.x + root.x) - startMouseCoord
if (deltaCoord > gestureThreshold) { if (deltaCoord > gestureThreshold) {
root.slideDrawerTo(startCoord < 0 ? 0 : closedX) root.slideDrawerTo(startCoord < 0 ? 0 : closedX)
} else if (deltaCoord < -gestureThreshold){ } else if (deltaCoord < -gestureThreshold){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment