PrintInformationWidget.qml 1.6 KB

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