Use re-usable TabRow component

Contributes to issue CURA-5876.
This commit is contained in:
Ghostkeeper 2018-11-22 17:06:56 +01:00
parent 7f11142d50
commit 4c26262054
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -29,22 +29,19 @@ Item
}
}
TabBar
UM.TabRow
{
id: tabBar
onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex)
anchors.top: header.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width
height: 50
onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex)
Repeater
{
model: extrudersModel
delegate: TabButton
delegate: UM.TabRowButton
{
width: ListView.view != null ? Math.round(ListView.view.width / extrudersModel.rowCount()): 0
height: parent.height
contentItem: Item
{
Cura.ExtruderIcon