ToolboxAuthorPage.qml 5.2 KB

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