ClusterMonitorItem.qml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import QtQuick 2.2
  2. import QtQuick.Controls 1.4
  3. import QtQuick.Controls.Styles 1.4
  4. import UM 1.3 as UM
  5. import Cura 1.0 as Cura
  6. Component
  7. {
  8. Rectangle
  9. {
  10. id: monitorFrame
  11. width: maximumWidth
  12. height: maximumHeight
  13. color: UM.Theme.getColor("viewport_background")
  14. property var emphasisColor: UM.Theme.getColor("setting_control_border_highlight")
  15. property var lineColor: "#DCDCDC" // TODO: Should be linked to theme.
  16. property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme.
  17. UM.I18nCatalog
  18. {
  19. id: catalog
  20. name: "cura"
  21. }
  22. Label
  23. {
  24. id: manageQueueLabel
  25. anchors.rightMargin: 5 * UM.Theme.getSize("default_margin").width
  26. anchors.right: queuedPrintJobs.right
  27. anchors.bottom: queuedLabel.bottom
  28. text: catalog.i18nc("@label link to connect manager", "Manage queue")
  29. font: UM.Theme.getFont("default")
  30. color: UM.Theme.getColor("primary")
  31. linkColor: UM.Theme.getColor("primary")
  32. }
  33. MouseArea
  34. {
  35. anchors.fill: manageQueueLabel
  36. hoverEnabled: true
  37. onClicked: Cura.MachineManager.printerOutputDevices[0].openPrintJobControlPanel()
  38. onEntered: manageQueueLabel.font.underline = true
  39. onExited: manageQueueLabel.font.underline = false
  40. }
  41. Label
  42. {
  43. id: queuedLabel
  44. anchors.left: queuedPrintJobs.left
  45. anchors.top: parent.top
  46. anchors.topMargin: 2 * UM.Theme.getSize("default_margin").height
  47. anchors.leftMargin: 3 * UM.Theme.getSize("default_margin").width
  48. text: catalog.i18nc("@label", "Queued")
  49. font: UM.Theme.getFont("large")
  50. color: UM.Theme.getColor("text")
  51. }
  52. ScrollView
  53. {
  54. id: queuedPrintJobs
  55. anchors
  56. {
  57. top: queuedLabel.bottom
  58. topMargin: UM.Theme.getSize("default_margin").height
  59. horizontalCenter: parent.horizontalCenter
  60. bottomMargin: 0
  61. bottom: parent.bottom
  62. }
  63. style: UM.Theme.styles.scrollview
  64. width: Math.min(800 * screenScaleFactor, maximumWidth)
  65. ListView
  66. {
  67. anchors.fill: parent
  68. //anchors.margins: UM.Theme.getSize("default_margin").height
  69. spacing: UM.Theme.getSize("default_margin").height - 10 // 2x the shadow radius
  70. model: OutputDevice.queuedPrintJobs
  71. delegate: PrintJobInfoBlock
  72. {
  73. printJob: modelData
  74. anchors.left: parent.left
  75. anchors.right: parent.right
  76. anchors.rightMargin: UM.Theme.getSize("default_margin").height
  77. anchors.leftMargin: UM.Theme.getSize("default_margin").height
  78. height: 175 * screenScaleFactor
  79. }
  80. }
  81. }
  82. PrinterVideoStream
  83. {
  84. visible: OutputDevice.activeCamera != null
  85. anchors.fill: parent
  86. camera: OutputDevice.activeCamera
  87. }
  88. onVisibleChanged:
  89. {
  90. if (monitorFrame != null && !monitorFrame.visible)
  91. {
  92. // After switching the Tab ensure that active printer is Null, the video stream image
  93. // might be active
  94. OutputDevice.setActiveCamera(null)
  95. }
  96. }
  97. }
  98. }