PrintInformationWidget.qml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 UM 1.1 as UM
  6. import Cura 1.0 as Cura
  7. UM.ColorImage
  8. {
  9. id: widget
  10. source: UM.Theme.getIcon("Information")
  11. width: visible ? UM.Theme.getSize("section_icon").width : 0
  12. height: UM.Theme.getSize("section_icon").height
  13. color: UM.Theme.getColor("icon")
  14. property var printMaterialCosts: PrintInformation.materialCosts
  15. MouseArea
  16. {
  17. anchors.fill: parent
  18. hoverEnabled: true
  19. onEntered: popup.open()
  20. onExited: popup.close()
  21. }
  22. Popup
  23. {
  24. id: popup
  25. y: -(height + UM.Theme.getSize("default_arrow").height + UM.Theme.getSize("thin_margin").height)
  26. x: parent.width - width + UM.Theme.getSize("thin_margin").width
  27. closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
  28. opacity: opened ? 1 : 0
  29. Behavior on opacity { NumberAnimation { duration: 100 } }
  30. contentItem: PrintJobInformation
  31. {
  32. id: printJobInformation
  33. width: UM.Theme.getSize("action_panel_information_widget").width
  34. }
  35. background: UM.PointingRectangle
  36. {
  37. color: UM.Theme.getColor("tool_panel_background")
  38. borderColor: UM.Theme.getColor("lining")
  39. borderWidth: UM.Theme.getSize("default_lining").width
  40. target: Qt.point(width - (widget.width / 2) - UM.Theme.getSize("thin_margin").width,
  41. height + UM.Theme.getSize("default_arrow").height - UM.Theme.getSize("thin_margin").height)
  42. arrowSize: UM.Theme.getSize("default_arrow").width
  43. }
  44. }
  45. }