ClusterMonitorItem.qml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.4
  5. import QtQuick.Controls.Styles 1.4
  6. import UM 1.3 as UM
  7. import Cura 1.0 as Cura
  8. import QtGraphicalEffects 1.0
  9. Component
  10. {
  11. Rectangle
  12. {
  13. id: monitorFrame
  14. property var emphasisColor: UM.Theme.getColor("setting_control_border_highlight")
  15. property var cornerRadius: UM.Theme.getSize("monitor_corner_radius").width
  16. color: "transparent"
  17. height: maximumHeight
  18. onVisibleChanged:
  19. {
  20. if (monitorFrame != null && !monitorFrame.visible)
  21. {
  22. OutputDevice.setActiveCameraUrl("")
  23. }
  24. }
  25. width: maximumWidth
  26. UM.I18nCatalog
  27. {
  28. id: catalog
  29. name: "cura"
  30. }
  31. LinearGradient {
  32. anchors.fill: parent
  33. gradient: Gradient {
  34. GradientStop {
  35. position: 0.0
  36. color: "#f6f6f6"
  37. }
  38. GradientStop {
  39. position: 1.0
  40. color: "#ffffff"
  41. }
  42. }
  43. }
  44. Item
  45. {
  46. id: queue
  47. anchors.fill: parent
  48. anchors.top: parent.top
  49. anchors.topMargin: 400 * screenScaleFactor // TODO: Insert carousel here
  50. Label
  51. {
  52. id: queuedLabel
  53. anchors
  54. {
  55. left: queuedPrintJobs.left
  56. top: parent.top
  57. }
  58. color: UM.Theme.getColor("text")
  59. font: UM.Theme.getFont("large_nonbold")
  60. text: catalog.i18nc("@label", "Queued")
  61. }
  62. Item
  63. {
  64. id: manageQueueLabel
  65. anchors
  66. {
  67. right: queuedPrintJobs.right
  68. verticalCenter: queuedLabel.verticalCenter
  69. }
  70. height: 18 * screenScaleFactor // TODO: Theme!
  71. width: childrenRect.width
  72. UM.RecolorImage
  73. {
  74. id: externalLinkIcon
  75. anchors.verticalCenter: manageQueueLabel.verticalCenter
  76. color: UM.Theme.getColor("primary")
  77. source: "../svg/icons/external_link.svg"
  78. width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
  79. height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
  80. }
  81. Label
  82. {
  83. id: manageQueueText
  84. anchors
  85. {
  86. left: externalLinkIcon.right
  87. leftMargin: 6 * screenScaleFactor // TODO: Theme!
  88. verticalCenter: externalLinkIcon.verticalCenter
  89. }
  90. color: UM.Theme.getColor("primary")
  91. font: UM.Theme.getFont("default")
  92. linkColor: UM.Theme.getColor("primary")
  93. text: catalog.i18nc("@label link to connect manager", "Manage queue in Cura Connect")
  94. }
  95. }
  96. MouseArea
  97. {
  98. anchors.fill: manageQueueLabel
  99. hoverEnabled: true
  100. onClicked: Cura.MachineManager.printerOutputDevices[0].openPrintJobControlPanel()
  101. onEntered:
  102. {
  103. manageQueueText.font.underline = true
  104. }
  105. onExited:
  106. {
  107. manageQueueText.font.underline = false
  108. }
  109. }
  110. Row
  111. {
  112. id: printJobQueueHeadings
  113. anchors
  114. {
  115. left: queuedPrintJobs.left
  116. leftMargin: 6 * screenScaleFactor // TODO: Theme!
  117. top: queuedLabel.bottom
  118. topMargin: 24 * screenScaleFactor // TODO: Theme!
  119. }
  120. spacing: 18 * screenScaleFactor // TODO: Theme!
  121. Label
  122. {
  123. text: catalog.i18nc("@label", "Print jobs")
  124. color: "#666666"
  125. elide: Text.ElideRight
  126. font: UM.Theme.getFont("medium") // 14pt, regular
  127. anchors.verticalCenter: parent.verticalCenter
  128. width: 284 * screenScaleFactor // TODO: Theme! (Should match column size)
  129. // FIXED-LINE-HEIGHT:
  130. height: 18 * screenScaleFactor // TODO: Theme!
  131. verticalAlignment: Text.AlignVCenter
  132. }
  133. Label
  134. {
  135. text: catalog.i18nc("@label", "Total print time")
  136. color: "#666666"
  137. elide: Text.ElideRight
  138. font: UM.Theme.getFont("medium") // 14pt, regular
  139. anchors.verticalCenter: parent.verticalCenter
  140. width: 216 * screenScaleFactor // TODO: Theme! (Should match column size)
  141. // FIXED-LINE-HEIGHT:
  142. height: 18 * screenScaleFactor // TODO: Theme!
  143. verticalAlignment: Text.AlignVCenter
  144. }
  145. Label
  146. {
  147. text: catalog.i18nc("@label", "Waiting for")
  148. color: "#666666"
  149. elide: Text.ElideRight
  150. font: UM.Theme.getFont("medium") // 14pt, regular
  151. anchors.verticalCenter: parent.verticalCenter
  152. width: 216 * screenScaleFactor // TODO: Theme! (Should match column size)
  153. // FIXED-LINE-HEIGHT:
  154. height: 18 * screenScaleFactor // TODO: Theme!
  155. verticalAlignment: Text.AlignVCenter
  156. }
  157. }
  158. ScrollView
  159. {
  160. id: queuedPrintJobs
  161. anchors {
  162. bottom: parent.bottom
  163. horizontalCenter: parent.horizontalCenter
  164. top: printJobQueueHeadings.bottom
  165. topMargin: 12 * screenScaleFactor // TODO: Theme!
  166. }
  167. style: UM.Theme.styles.scrollview
  168. visible: OutputDevice.receivedPrintJobs
  169. width: Math.min(834 * screenScaleFactor, maximumWidth)
  170. ListView
  171. {
  172. id: printJobList
  173. anchors.fill: parent
  174. delegate: MonitorPrintJobCard
  175. {
  176. anchors
  177. {
  178. left: parent.left
  179. right: parent.right
  180. }
  181. printJob: modelData
  182. }
  183. model: OutputDevice.queuedPrintJobs
  184. spacing: 6
  185. }
  186. }
  187. }
  188. PrinterVideoStream {
  189. anchors.fill: parent
  190. cameraUrl: OutputDevice.activeCameraUrl
  191. visible: OutputDevice.activeCameraUrl != ""
  192. }
  193. }
  194. }