Cura/resources/qml/Widgets/ExtruderSelectorBar.qml
Joey de l'Arago 631d6a15b0 Add extruder button bar that shows icons for each extruder in a horizontal row 💪
Make ExtruderButton more generic by moving functionality out.

Remove background color from ToolbarButton and add that background color to the Toolbar.qml.

Fix Toolbar border being created by overlapping rectangles instead of using border

Add scaling options for ToolBarButtons icon

CURA-9793
2022-11-28 15:55:55 +01:00

40 lines
1 KiB
QML

import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
import UM 1.5 as UM
import Cura 1.5 as Cura
Row
{
id: extruderSelectionBar
property alias model: extruderButtonRepeater.model
spacing: 0
width: parent.width
height: childrenRect.height
Repeater
{
id: extruderButtonRepeater
delegate: Item
{
width: {
const maximum_width = Math.floor(extruderSelectionBar.width / extruderButtonRepeater.count);
return Math.min(UM.Theme.getSize("large_button").width, maximum_width);
}
height: childrenRect.height
Cura.ExtruderButton
{
extruder: model
isTopElement: extrudersModel.getItem(0).id == model.id
isBottomElement: extrudersModel.getItem(extrudersModel.rowCount() - 1).id == model.id
iconScale: 0.6
buttonSize: UM.Theme.getSize("large_button").width
}
}
}
}