RibbonTabBar: Add setPage func.
This commit is contained in:
parent
38d5ca8d89
commit
300d93e2bc
|
@ -90,7 +90,6 @@ Item{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right:tool_bar.left
|
right:tool_bar.left
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Item{}
|
background: Item{}
|
||||||
position: TabBar.Header
|
position: TabBar.Header
|
||||||
currentIndex: stack.currentIndex
|
currentIndex: stack.currentIndex
|
||||||
|
@ -299,4 +298,20 @@ Item{
|
||||||
timer.start()
|
timer.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setPage(index)
|
||||||
|
{
|
||||||
|
for (let i=0, count = 0; i < bar.contentChildren.length; i++)
|
||||||
|
{
|
||||||
|
let item = bar.itemAt(i)
|
||||||
|
if(item instanceof RibbonTabButton){
|
||||||
|
if (count === index)
|
||||||
|
{
|
||||||
|
item.checked = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue