ToolboxAuthorPage.qml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. Rectangle
  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", "Contact") + ":"
  85. font: UM.Theme.getFont("very_small")
  86. color: UM.Theme.getColor("text_medium")
  87. }
  88. }
  89. Column
  90. {
  91. id: values
  92. anchors
  93. {
  94. top: description.bottom
  95. left: properties.right
  96. leftMargin: UM.Theme.getSize("default_margin").width
  97. topMargin: UM.Theme.getSize("default_margin").height
  98. }
  99. spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
  100. Label
  101. {
  102. text:
  103. {
  104. if (details.email)
  105. {
  106. return "<a href=\"mailto:"+details.email+"\">"+details.name+"</a>"
  107. }
  108. else
  109. {
  110. return "<a href=\""+details.website+"\">"+details.name+"</a>"
  111. }
  112. }
  113. font: UM.Theme.getFont("very_small")
  114. color: UM.Theme.getColor("text")
  115. linkColor: UM.Theme.getColor("text_link")
  116. onLinkActivated: Qt.openUrlExternally(link)
  117. }
  118. }
  119. Rectangle
  120. {
  121. color: UM.Theme.getColor("lining")
  122. width: parent.width
  123. height: UM.Theme.getSize("default_lining").height
  124. anchors.bottom: parent.bottom
  125. }
  126. }
  127. ToolboxDetailList
  128. {
  129. anchors
  130. {
  131. top: header.bottom
  132. bottom: page.bottom
  133. left: header.left
  134. right: page.right
  135. }
  136. }
  137. }