mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 14:34:01 -06:00
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
This commit is contained in:
parent
30d886cfcd
commit
631d6a15b0
6 changed files with 70 additions and 18 deletions
40
resources/qml/Widgets/ExtruderSelectorBar.qml
Normal file
40
resources/qml/Widgets/ExtruderSelectorBar.qml
Normal file
|
@ -0,0 +1,40 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue