mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
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
40 lines
1 KiB
QML
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
|
|
}
|
|
}
|
|
}
|
|
}
|