ToolboxAuthorPage.qml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  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: base
  10. property var details: toolbox.authorsModel.items[0]
  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("double_margin").width
  24. }
  25. height: UM.Theme.getSize("base_unit").height * 12
  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. anchors
  34. {
  35. top: parent.top
  36. left: parent.left
  37. leftMargin: UM.Theme.getSize("double_margin").width
  38. topMargin: UM.Theme.getSize("double_margin").height
  39. }
  40. }
  41. Label
  42. {
  43. id: title
  44. anchors
  45. {
  46. top: thumbnail.top
  47. left: thumbnail.right
  48. leftMargin: UM.Theme.getSize("default_margin").width
  49. right: parent.right
  50. rightMargin: UM.Theme.getSize("double_margin").width
  51. bottomMargin: UM.Theme.getSize("default_margin").height
  52. }
  53. text: details.name
  54. font: UM.Theme.getFont("large")
  55. wrapMode: Text.WordWrap
  56. width: parent.width
  57. height: UM.Theme.getSize("base_unit") * 2
  58. }
  59. Label
  60. {
  61. id: description
  62. text: details.description
  63. anchors
  64. {
  65. top: title.bottom
  66. left: title.left
  67. topMargin: UM.Theme.getSize("default_margin").height
  68. }
  69. }
  70. Column
  71. {
  72. id: properties
  73. anchors
  74. {
  75. top: description.bottom
  76. left: description.left
  77. topMargin: UM.Theme.getSize("default_margin").height
  78. }
  79. spacing: Math.floor(UM.Theme.getSize("default_margin").height / 2)
  80. width: childrenRect.width
  81. Label
  82. {
  83. text: catalog.i18nc("@label", "Contact") + ":"
  84. font: UM.Theme.getFont("very_small")
  85. color: UM.Theme.getColor("text_medium")
  86. }
  87. }
  88. Column
  89. {
  90. id: values
  91. anchors
  92. {
  93. top: description.bottom
  94. left: properties.right
  95. leftMargin: UM.Theme.getSize("default_margin").width
  96. topMargin: UM.Theme.getSize("default_margin").height
  97. }
  98. spacing: Math.floor(UM.Theme.getSize("default_margin").height/2)
  99. width: UM.Theme.getSize("base_unit").width * 12
  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. onLinkActivated: Qt.openUrlExternally(link)
  116. }
  117. }
  118. Rectangle
  119. {
  120. color: UM.Theme.getColor("lining")
  121. width: parent.width
  122. height: UM.Theme.getSize("default_lining").height
  123. anchors.bottom: parent.bottom
  124. }
  125. }
  126. ToolboxDetailList
  127. {
  128. anchors
  129. {
  130. top: header.bottom
  131. bottom: base.bottom
  132. left: header.left
  133. right: base.right
  134. }
  135. }
  136. }