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.RecolorImage
  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. 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. contentWidth: printJobInformation.width
  30. contentHeight: printJobInformation.implicitHeight
  31. contentItem: PrintJobInformation
  32. {
  33. id: printJobInformation
  34. width: UM.Theme.getSize("action_panel_information_widget").width
  35. }
  36. background: UM.PointingRectangle
  37. {
  38. color: UM.Theme.getColor("tool_panel_background")
  39. borderColor: UM.Theme.getColor("lining")
  40. borderWidth: UM.Theme.getSize("default_lining").width
  41. target: Qt.point(width - (widget.width / 2) - UM.Theme.getSize("thin_margin").width,
  42. height + UM.Theme.getSize("default_arrow").height - UM.Theme.getSize("thin_margin").height)
  43. arrowSize: UM.Theme.getSize("default_arrow").width
  44. }
  45. }
  46. }