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 id: tabBar
onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex)
anchors.top: header.bottom anchors.top: header.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width
height: 50 onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex)
Repeater Repeater
{ {
model: extrudersModel model: extrudersModel
delegate: UM.TabRowButton
delegate: TabButton
{ {
width: ListView.view != null ? Math.round(ListView.view.width / extrudersModel.rowCount()): 0
height: parent.height
contentItem: Item contentItem: Item
{ {
Cura.ExtruderIcon Cura.ExtruderIcon