ToolboxAuthorPage.qml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 1.4
  5. import QtQuick.Controls.Styles 1.4
  6. import UM 1.1 as UM
  7. import "../components"
  8. Item
  9. {
  10. id: page
  11. property var details: base.selection || {}
  12. anchors.fill: parent
  13. ToolboxBackColumn
  14. {
  15. id: sidebar
  16. }
  17. Item
  18. {
  19. id: header
  20. anchors
  21. {
  22. left: sidebar.right
  23. right: parent.right
  24. rightMargin: UM.Theme.getSize("wide_margin").width
  25. }
  26. height: UM.Theme.getSize("toolbox_detail_header").height
  27. Image
  28. {
  29. id: thumbnail
  30. width: UM.Theme.getSize("toolbox_thumbnail_medium").width
  31. height: UM.Theme.getSize("toolbox_thumbnail_medium").height
  32. fillMode: Image.PreserveAspectFit
  33. source: details.icon_url || "../../images/logobot.svg"
  34. mipmap: true
  35. anchors
  36. {
  37. top: parent.top
  38. left: parent.left
  39. leftMargin: UM.Theme.getSize("wide_margin").width
  40. topMargin: UM.Theme.getSize("wide_margin").height
  41. }
  42. }
  43. Label
  44. {
  45. id: title
  46. anchors
  47. {
  48. top: thumbnail.top
  49. left: thumbnail.right
  50. leftMargin: UM.Theme.getSize("default_margin").width
  51. right: parent.right
  52. rightMargin: UM.Theme.getSize("wide_margin").width
  53. bottomMargin: UM.Theme.getSize("default_margin").height
  54. }
  55. text: details.name || ""
  56. font: UM.Theme.getFont("large_bold")
  57. wrapMode: Text.WordWrap
  58. width: parent.width
  59. height: UM.Theme.getSize("toolbox_property_label").height
  60. renderType: Text.NativeRendering
  61. }
  62. Label
  63. {
  64. id: description
  65. text: details.description || ""
  66. font: UM.Theme.getFont("default")
  67. anchors
  68. {
  69. top: title.bottom
  70. left: title.left
  71. topMargin: UM.Theme.getSize("default_margin").height
  72. }
  73. renderType: Text.NativeRendering
  74. }
  75. Column
  76. {
  77. id: properties
  78. anchors
  79. {
  80. top: description.bottom
  81. left: description.left
  82. topMargin: UM.Theme.getSize("default_margin").height
  83. }
  84. spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
  85. width: childrenRect.width
  86. Label
  87. {
  88. text: catalog.i18nc("@label", "Website") + ":"
  89. font: UM.Theme.getFont("default")
  90. color: UM.Theme.getColor("text_medium")
  91. renderType: Text.NativeRendering
  92. }
  93. Label
  94. {
  95. text: catalog.i18nc("@label", "Email") + ":"
  96. font: UM.Theme.getFont("default")
  97. color: UM.Theme.getColor("text_medium")
  98. renderType: Text.NativeRendering
  99. }
  100. }
  101. Column
  102. {
  103. id: values
  104. anchors
  105. {
  106. top: description.bottom
  107. left: properties.right
  108. leftMargin: UM.Theme.getSize("default_margin").width
  109. right: parent.right
  110. rightMargin: UM.Theme.getSize("default_margin").width
  111. topMargin: UM.Theme.getSize("default_margin").height
  112. }
  113. spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
  114. Label
  115. {
  116. text:
  117. {
  118. if (details.website)
  119. {
  120. return "<a href=\"" + details.website + "\">" + details.website + "</a>"
  121. }
  122. return ""
  123. }
  124. width: parent.width
  125. elide: Text.ElideRight
  126. font: UM.Theme.getFont("default")
  127. color: UM.Theme.getColor("text")
  128. linkColor: UM.Theme.getColor("text_link")
  129. onLinkActivated: Qt.openUrlExternally(link)
  130. renderType: Text.NativeRendering
  131. }
  132. Label
  133. {
  134. text:
  135. {
  136. if (details.email)
  137. {
  138. return "<a href=\"mailto:" + details.email + "\">" + details.email + "</a>"
  139. }
  140. return ""
  141. }
  142. font: UM.Theme.getFont("default")
  143. color: UM.Theme.getColor("text")
  144. linkColor: UM.Theme.getColor("text_link")
  145. onLinkActivated: Qt.openUrlExternally(link)
  146. renderType: Text.NativeRendering
  147. }
  148. }
  149. Rectangle
  150. {
  151. color: UM.Theme.getColor("lining")
  152. width: parent.width
  153. height: UM.Theme.getSize("default_lining").height
  154. anchors.bottom: parent.bottom
  155. }
  156. }
  157. ToolboxDetailList
  158. {
  159. anchors
  160. {
  161. top: header.bottom
  162. bottom: page.bottom
  163. left: header.left
  164. right: page.right
  165. }
  166. }
  167. }