ActionPanelWidget.qml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Controls 2.1
  5. import QtQuick.Layouts 1.3
  6. import UM 1.2 as UM
  7. import Cura 1.0 as Cura
  8. // This element hold all the elements needed for the user to trigger the slicing process, and later
  9. // to get information about the printing times, material consumption and the output process (such as
  10. // saving to a file, printing over network, ...
  11. Rectangle
  12. {
  13. id: actionPanelWidget
  14. width: UM.Theme.getSize("action_panel_widget").width
  15. height: childrenRect.height + 2 * UM.Theme.getSize("thick_margin").height
  16. color: UM.Theme.getColor("main_background")
  17. border.width: UM.Theme.getSize("default_lining").width
  18. border.color: UM.Theme.getColor("lining")
  19. radius: UM.Theme.getSize("default_radius").width
  20. property bool outputAvailable: UM.Backend.state == UM.Backend.Done || UM.Backend.state == UM.Backend.Disabled
  21. Loader
  22. {
  23. id: loader
  24. anchors
  25. {
  26. top: parent.top
  27. topMargin: UM.Theme.getSize("thick_margin").height
  28. left: parent.left
  29. leftMargin: UM.Theme.getSize("thick_margin").width
  30. right: parent.right
  31. rightMargin: UM.Theme.getSize("thick_margin").width
  32. }
  33. sourceComponent: outputAvailable ? outputProcessWidget : sliceProcessWidget
  34. }
  35. Component
  36. {
  37. id: sliceProcessWidget
  38. SliceProcessWidget { }
  39. }
  40. Component
  41. {
  42. id: outputProcessWidget
  43. OutputProcessWidget { }
  44. }
  45. }