Fixed wheel scroll when mouse is outside of center area

This commit is contained in:
Eric Kotato 2018-03-01 09:48:21 +03:00
parent 04ba42f1a1
commit 9982097de4
4 changed files with 37 additions and 46 deletions

View file

@ -272,5 +272,41 @@ Rectangle
buttonWeekday.updateTime()
}
}
MouseArea
{
id: scrollMouseArea
anchors.fill: parent
propagateComposedEvents: true
onWheel:
{
switch (root.state)
{
case "statePower":
if (wheel.pixelDelta.y < 0)
pagePower.scroll_up()
else
pagePower.scroll_down()
break
case "stateSessions":
if (wheel.pixelDelta.y < 0)
pageSessions.scroll_up()
else
pageSessions.scroll_down()
break
case "stateUsers":
if (!pagePower.hasLoginShown)
{
if (wheel.pixelDelta.y < 0)
pageUsers.scroll_up()
else
pageUsers.scroll_down()
}
break
}
}
}
}

View file

@ -245,18 +245,4 @@ Item
Keys.onDownPressed: scroll_up()
Keys.onEnterPressed: execute()
Keys.onReturnPressed: execute()
MouseArea
{
id: listMouseArea
anchors.fill: parent
propagateComposedEvents: true
onWheel:
{
if (wheel.pixelDelta.y < 0)
scroll_up()
else
scroll_down()
}
}
}

View file

@ -280,18 +280,4 @@ Item
Keys.onEnterPressed: pageRoot.sessionSelected()
Keys.onReturnPressed: pageRoot.sessionSelected()
MouseArea
{
id: listMouseArea
anchors.fill: parent
propagateComposedEvents: true
onWheel:
{
if (wheel.pixelDelta.y < 0)
scroll_up()
else
scroll_down()
}
}
}

View file

@ -588,21 +588,4 @@ Item
Keys.onReturnPressed: select_or_login()
Keys.onEscapePressed: back_to_selection()
MouseArea
{
id: listMouseArea
anchors.fill: parent
propagateComposedEvents: true
onWheel:
{
if (!hasLoginShown)
{
if (wheel.pixelDelta.y < 0)
scroll_up()
else
scroll_down()
}
}
}
}