AboutDialog.qml.jinja 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. // Copyright (c) 2023 UltiMaker
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 2.9
  5. import UM 1.5 as UM
  6. import Cura 1.5 as Cura
  7. UM.Dialog
  8. {
  9. id: base
  10. //: About dialog title
  11. title: catalog.i18nc("@title:window The argument is the application name.", "About %1").arg(CuraApplication.applicationDisplayName)
  12. minimumWidth: 500 * screenScaleFactor
  13. minimumHeight: 700 * screenScaleFactor
  14. width: minimumWidth
  15. height: minimumHeight
  16. backgroundColor: UM.Theme.getColor("main_background")
  17. Rectangle
  18. {
  19. id: header
  20. width: parent.width + 2 * margin // margin from Dialog.qml
  21. height: childrenRect.height + topPadding
  22. anchors.top: parent.top
  23. anchors.topMargin: -margin
  24. anchors.horizontalCenter: parent.horizontalCenter
  25. property real topPadding: UM.Theme.getSize("wide_margin").height
  26. color: UM.Theme.getColor("main_window_header_background")
  27. Image
  28. {
  29. id: logo
  30. width: (base.minimumWidth * 0.85) | 0
  31. height: (width * (UM.Theme.getSize("logo").height / UM.Theme.getSize("logo").width)) | 0
  32. source: UM.Theme.getImage("logo")
  33. sourceSize.width: width
  34. sourceSize.height: height
  35. fillMode: Image.PreserveAspectFit
  36. anchors.top: parent.top
  37. anchors.topMargin: parent.topPadding
  38. anchors.horizontalCenter: parent.horizontalCenter
  39. UM.I18nCatalog{id: catalog; name: "cura"}
  40. }
  41. UM.Label
  42. {
  43. id: version
  44. text: catalog.i18nc("@label","version: %1").arg(UM.Application.version)
  45. font: UM.Theme.getFont("large_bold")
  46. color: UM.Theme.getColor("button_text")
  47. anchors.right : logo.right
  48. anchors.top: logo.bottom
  49. anchors.topMargin: (UM.Theme.getSize("default_margin").height / 2) | 0
  50. }
  51. }
  52. UM.Label
  53. {
  54. id: description
  55. width: parent.width
  56. //: About dialog application description
  57. text: catalog.i18nc("@label","End-to-end solution for fused filament 3D printing.")
  58. font: UM.Theme.getFont("system")
  59. wrapMode: Text.WordWrap
  60. anchors.top: header.bottom
  61. anchors.topMargin: UM.Theme.getSize("default_margin").height
  62. }
  63. UM.Label
  64. {
  65. id: creditsNotes
  66. width: parent.width
  67. //: About dialog application author note
  68. text: catalog.i18nc("@info:credit","Cura is developed by UltiMaker in cooperation with the community.\nCura proudly uses the following open source projects:")
  69. font: UM.Theme.getFont("system")
  70. wrapMode: Text.WordWrap
  71. anchors.top: description.bottom
  72. anchors.topMargin: UM.Theme.getSize("default_margin").height
  73. }
  74. ListView
  75. {
  76. id: projectsList
  77. anchors.top: creditsNotes.bottom
  78. anchors.topMargin: UM.Theme.getSize("default_margin").height
  79. width: parent.width
  80. height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height)
  81. ScrollBar.vertical: UM.ScrollBar
  82. {
  83. id: projectsListScrollBar
  84. }
  85. delegate: Row
  86. {
  87. spacing: UM.Theme.getSize("narrow_margin").width
  88. UM.Label
  89. {
  90. text: model.name
  91. width: (projectsList.width * 0.50) | 0
  92. elide: Text.ElideRight
  93. }
  94. UM.Label
  95. {
  96. text: model.version
  97. elide: Text.ElideRight
  98. width: ((projectsList.width * 0.5) | 0) - parent.spacing * 2 - projectsListScrollBar.width
  99. }
  100. UM.Label
  101. {
  102. text: model.license
  103. elide: Text.ElideRight
  104. width: (projectsList.width * 0.25) | 0
  105. }
  106. }
  107. model: ListModel
  108. {
  109. id: projectsModel
  110. }
  111. Component.onCompleted:
  112. {
  113. {% for dep in dependencies %}projectsModel.append({ name: "{{ dep.name }}", version: "{{ dep.version }}", license: "{{ dep.license }}" });
  114. {% endfor %}
  115. }
  116. }
  117. rightButtons: Cura.TertiaryButton
  118. {
  119. //: Close about dialog button
  120. id: closeButton
  121. text: catalog.i18nc("@action:button", "Close")
  122. onClicked: reject()
  123. }
  124. }