ActionPanelWidget.qml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. Rectangle
  9. {
  10. id: actionPanelWidget
  11. width: childrenRect.width + 2 * UM.Theme.getSize("thick_margin").width
  12. height: childrenRect.height + 2 * UM.Theme.getSize("thick_margin").height
  13. color: UM.Theme.getColor("main_background")
  14. border.width: UM.Theme.getSize("default_lining").width
  15. border.color: UM.Theme.getColor("lining")
  16. radius: UM.Theme.getSize("default_radius").width
  17. visible: CuraApplication.platformActivity
  18. property bool outputAvailable: UM.Backend.state == UM.Backend.Done || UM.Backend.state == UM.Backend.Disabled
  19. Loader
  20. {
  21. id: loader
  22. anchors
  23. {
  24. top: parent.top
  25. topMargin: UM.Theme.getSize("thick_margin").height
  26. left: parent.left
  27. leftMargin: UM.Theme.getSize("thick_margin").width
  28. }
  29. sourceComponent: outputAvailable ? outputProcessWidget : sliceProcessWidget
  30. }
  31. Behavior on height { NumberAnimation { duration: 100 } }
  32. Behavior on width { NumberAnimation { duration: 100 } }
  33. Component
  34. {
  35. id: sliceProcessWidget
  36. SliceProcessWidget { }
  37. }
  38. Component
  39. {
  40. id: outputProcessWidget
  41. OutputProcessWidget { }
  42. }
  43. }