Fixed wheel scroll when mouse is outside of center area
This commit is contained in:
parent
04ba42f1a1
commit
9982097de4
4 changed files with 37 additions and 46 deletions
|
|
@ -272,5 +272,41 @@ Rectangle
|
||||||
buttonWeekday.updateTime()
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -245,18 +245,4 @@ Item
|
||||||
Keys.onDownPressed: scroll_up()
|
Keys.onDownPressed: scroll_up()
|
||||||
Keys.onEnterPressed: execute()
|
Keys.onEnterPressed: execute()
|
||||||
Keys.onReturnPressed: execute()
|
Keys.onReturnPressed: execute()
|
||||||
|
|
||||||
MouseArea
|
|
||||||
{
|
|
||||||
id: listMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
propagateComposedEvents: true
|
|
||||||
onWheel:
|
|
||||||
{
|
|
||||||
if (wheel.pixelDelta.y < 0)
|
|
||||||
scroll_up()
|
|
||||||
else
|
|
||||||
scroll_down()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -280,18 +280,4 @@ Item
|
||||||
Keys.onEnterPressed: pageRoot.sessionSelected()
|
Keys.onEnterPressed: pageRoot.sessionSelected()
|
||||||
Keys.onReturnPressed: 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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -587,22 +587,5 @@ Item
|
||||||
Keys.onEnterPressed: select_or_login()
|
Keys.onEnterPressed: select_or_login()
|
||||||
Keys.onReturnPressed: select_or_login()
|
Keys.onReturnPressed: select_or_login()
|
||||||
Keys.onEscapePressed: back_to_selection()
|
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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue