Solve bug to get the same index action when stackview is changed without using sidebar

This commit is contained in:
Angela Mazzurco 2017-06-22 15:21:09 +02:00
parent 27593633fc
commit 356d3ab09f

View File

@ -44,14 +44,16 @@ Drawer
MouseArea MouseArea
{ {
property var lastItem
width: parent.width width: parent.width
height: parent.height height: parent.height
onClicked: onClicked:
{ {
if (listView.currentIndex != index) if (listView.currentIndex != index || stackView.currentItem != lastItem)
{ {
listView.currentIndex = index listView.currentIndex = index
menuList.actions[model.title](); menuList.actions[model.title]();
lastItem = stackView.currentItem
// titleLabel.text = model.title // titleLabel.text = model.title
// stackView.replace(model.source) // stackView.replace(model.source)
} }
@ -87,6 +89,7 @@ Drawer
model: ListModel model: ListModel
{ {
id: menuList id: menuList
property var actions : property var actions :
{ {
"Trusted Nodes": function() "Trusted Nodes": function()