ExtruderButton.qml 971 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2017 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 2.0
  5. import UM 1.2 as UM
  6. import Cura 1.0 as Cura
  7. Cura.ToolbarButton
  8. {
  9. id: base
  10. property var extruder
  11. text: catalog.i18ncp("@label %1 is filled in with the name of an extruder", "Print Selected Model with %1", "Print Selected Models with %1", UM.Selection.selectionCount).arg(extruder.name)
  12. checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1
  13. enabled: UM.Selection.hasSelection && extruder.stack.isEnabled
  14. toolItem: ExtruderIcon
  15. {
  16. materialColor: extruder.color
  17. extruderEnabled: extruder.stack.isEnabled
  18. iconVariant: "default"
  19. property int index: extruder.index
  20. }
  21. onClicked:
  22. {
  23. forceActiveFocus() //First grab focus, so all the text fields are updated
  24. CuraActions.setExtruderForSelection(extruder.id)
  25. }
  26. }