ToolboxAuthorPage.qml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.3
  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")
  56. wrapMode: Text.WordWrap
  57. width: parent.width
  58. height: UM.Theme.getSize("toolbox_property_label").height
  59. }
  60. Label
  61. {
  62. id: description
  63. text: details.description || ""
  64. anchors
  65. {
  66. top: title.bottom
  67. left: title.left
  68. topMargin: UM.Theme.getSize("default_margin").height
  69. }
  70. }
  71. Column
  72. {
  73. id: properties
  74. anchors
  75. {
  76. top: description.bottom
  77. left: description.left
  78. topMargin: UM.Theme.getSize("default_margin").height
  79. }
  80. spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
  81. width: childrenRect.width
  82. Label
  83. {
  84. text: catalog.i18nc("@label", "Website") + ":"
  85. font: UM.Theme.getFont("very_small")
  86. color: UM.Theme.getColor("text_medium")
  87. }
  88. Label
  89. {
  90. text: catalog.i18nc("@label", "Email") + ":"
  91. font: UM.Theme.getFont("very_small")
  92. color: UM.Theme.getColor("text_medium")
  93. }
  94. }
  95. Column
  96. {
  97. id: values
  98. anchors
  99. {
  100. top: description.bottom
  101. left: properties.right
  102. leftMargin: UM.Theme.getSize("default_margin").width
  103. topMargin: UM.Theme.getSize("default_margin").height
  104. }
  105. spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
  106. Label
  107. {
  108. text:
  109. {
  110. if (details.website)
  111. {
  112. return "<a href=\"" + details.website + "\">" + details.website + "</a>"
  113. }
  114. return ""
  115. }
  116. font: UM.Theme.getFont("very_small")
  117. color: UM.Theme.getColor("text")
  118. linkColor: UM.Theme.getColor("text_link")
  119. onLinkActivated: Qt.openUrlExternally(link)
  120. }
  121. Label
  122. {
  123. text:
  124. {
  125. if (details.email)
  126. {
  127. return "<a href=\"mailto:" + details.email + "\">" + details.email + "</a>"
  128. }
  129. return ""
  130. }
  131. font: UM.Theme.getFont("very_small")
  132. color: UM.Theme.getColor("text")
  133. linkColor: UM.Theme.getColor("text_link")
  134. onLinkActivated: Qt.openUrlExternally(link)
  135. }
  136. }
  137. Rectangle
  138. {
  139. color: UM.Theme.getColor("lining")
  140. width: parent.width
  141. height: UM.Theme.getSize("default_lining").height
  142. anchors.bottom: parent.bottom
  143. }
  144. }
  145. ToolboxDetailList
  146. {
  147. anchors
  148. {
  149. top: header.bottom
  150. bottom: page.bottom
  151. left: header.left
  152. right: page.right
  153. }
  154. }
  155. }