ToolboxAuthorPage.qml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. anchors
  66. {
  67. top: title.bottom
  68. left: title.left
  69. topMargin: UM.Theme.getSize("default_margin").height
  70. }
  71. renderType: Text.NativeRendering
  72. }
  73. Column
  74. {
  75. id: properties
  76. anchors
  77. {
  78. top: description.bottom
  79. left: description.left
  80. topMargin: UM.Theme.getSize("default_margin").height
  81. }
  82. spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
  83. width: childrenRect.width
  84. Label
  85. {
  86. text: catalog.i18nc("@label", "Website") + ":"
  87. font: UM.Theme.getFont("default")
  88. color: UM.Theme.getColor("text_medium")
  89. renderType: Text.NativeRendering
  90. }
  91. Label
  92. {
  93. text: catalog.i18nc("@label", "Email") + ":"
  94. font: UM.Theme.getFont("default")
  95. color: UM.Theme.getColor("text_medium")
  96. renderType: Text.NativeRendering
  97. }
  98. }
  99. Column
  100. {
  101. id: values
  102. anchors
  103. {
  104. top: description.bottom
  105. left: properties.right
  106. leftMargin: UM.Theme.getSize("default_margin").width
  107. topMargin: UM.Theme.getSize("default_margin").height
  108. }
  109. spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
  110. Label
  111. {
  112. text:
  113. {
  114. if (details.website)
  115. {
  116. return "<a href=\"" + details.website + "\">" + details.website + "</a>"
  117. }
  118. return ""
  119. }
  120. font: UM.Theme.getFont("default")
  121. color: UM.Theme.getColor("text")
  122. linkColor: UM.Theme.getColor("text_link")
  123. onLinkActivated: Qt.openUrlExternally(link)
  124. renderType: Text.NativeRendering
  125. }
  126. Label
  127. {
  128. text:
  129. {
  130. if (details.email)
  131. {
  132. return "<a href=\"mailto:" + details.email + "\">" + details.email + "</a>"
  133. }
  134. return ""
  135. }
  136. font: UM.Theme.getFont("default")
  137. color: UM.Theme.getColor("text")
  138. linkColor: UM.Theme.getColor("text_link")
  139. onLinkActivated: Qt.openUrlExternally(link)
  140. renderType: Text.NativeRendering
  141. }
  142. }
  143. Rectangle
  144. {
  145. color: UM.Theme.getColor("lining")
  146. width: parent.width
  147. height: UM.Theme.getSize("default_lining").height
  148. anchors.bottom: parent.bottom
  149. }
  150. }
  151. ToolboxDetailList
  152. {
  153. anchors
  154. {
  155. top: header.bottom
  156. bottom: page.bottom
  157. left: header.left
  158. right: page.right
  159. }
  160. }
  161. }