ActionPanelWidget.qml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. z: 10
  21. property bool outputAvailable: UM.Backend.state == UM.Backend.Done || UM.Backend.state == UM.Backend.Disabled
  22. Loader
  23. {
  24. id: loader
  25. anchors
  26. {
  27. top: parent.top
  28. topMargin: UM.Theme.getSize("thick_margin").height
  29. left: parent.left
  30. leftMargin: UM.Theme.getSize("thick_margin").width
  31. right: parent.right
  32. rightMargin: UM.Theme.getSize("thick_margin").width
  33. }
  34. sourceComponent: outputAvailable ? outputProcessWidget : sliceProcessWidget
  35. }
  36. Component
  37. {
  38. id: sliceProcessWidget
  39. SliceProcessWidget { }
  40. }
  41. Component
  42. {
  43. id: outputProcessWidget
  44. OutputProcessWidget { }
  45. }
  46. }