ToolboxViewDetail.qml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // PluginBrowser is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Dialogs 1.1
  5. import QtQuick.Controls 1.4
  6. import QtQuick.Controls.Styles 1.4
  7. import UM 1.1 as UM
  8. // TODO: Switch to QtQuick.Controls 2.x and remove QtQuick.Controls.Styles
  9. Item
  10. {
  11. id: base
  12. anchors.fill: parent
  13. Item
  14. {
  15. id: sidebar
  16. height: parent.height
  17. width: UM.Theme.getSize("base_unit").width * 6
  18. anchors
  19. {
  20. top: parent.top
  21. left: parent.left
  22. topMargin: UM.Theme.getSize("double_margin").height
  23. leftMargin: UM.Theme.getSize("default_margin").width
  24. rightMargin: UM.Theme.getSize("default_margin").width
  25. }
  26. Button
  27. {
  28. text: "Back"
  29. UM.RecolorImage
  30. {
  31. id: backArrow
  32. anchors.verticalCenter: parent.verticalCenter
  33. anchors.left: parent.left
  34. anchors.rightMargin: UM.Theme.getSize("default_margin").width
  35. width: UM.Theme.getSize("standard_arrow").width
  36. height: UM.Theme.getSize("standard_arrow").height
  37. sourceSize.width: width
  38. sourceSize.height: height
  39. color: UM.Theme.getColor("text")
  40. source: UM.Theme.getIcon("arrow_left")
  41. }
  42. width: UM.Theme.getSize("base_unit").width * 4
  43. height: UM.Theme.getSize("base_unit").height * 2
  44. onClicked:
  45. {
  46. manager.setDetailView("")
  47. }
  48. style: ButtonStyle
  49. {
  50. background: Rectangle
  51. {
  52. color: "transparent"
  53. }
  54. label: Label
  55. {
  56. text: control.text
  57. color: UM.Theme.getColor("text")
  58. font: UM.Theme.getFont("default_bold")
  59. horizontalAlignment: Text.AlignRight
  60. width: control.width
  61. }
  62. }
  63. }
  64. }
  65. Rectangle
  66. {
  67. id: header
  68. anchors
  69. {
  70. left: sidebar.right
  71. right: parent.right
  72. }
  73. height: UM.Theme.getSize("base_unit").height * 12
  74. Rectangle
  75. {
  76. id: thumbnail
  77. width: UM.Theme.getSize("toolbox_thumbnail_medium").width
  78. height: UM.Theme.getSize("toolbox_thumbnail_medium").height
  79. color: "grey"
  80. anchors
  81. {
  82. top: parent.top
  83. left: parent.left
  84. leftMargin: UM.Theme.getSize("double_margin").width
  85. topMargin: UM.Theme.getSize("double_margin").height
  86. }
  87. }
  88. Column
  89. {
  90. anchors
  91. {
  92. top: thumbnail.top
  93. left: thumbnail.right
  94. leftMargin: UM.Theme.getSize("default_margin").width
  95. right: parent.right
  96. rightMargin: UM.Theme.getSize("double_margin").width
  97. }
  98. spacing: Math.floor(UM.Theme.getSize("default_margin").height/2)
  99. Label
  100. {
  101. text: "DSM"
  102. font: UM.Theme.getFont("large")
  103. wrapMode: Text.WordWrap
  104. width: parent.width
  105. }
  106. Label
  107. {
  108. text: "Sets the horizontal and vertical alignment of the text within the Text items width and height. By default, the text is vertically aligned to the top."
  109. font: UM.Theme.getFont("default")
  110. wrapMode: Text.WordWrap
  111. width: parent.width
  112. }
  113. Label
  114. {
  115. text: "Author: " + "DSM"
  116. font: UM.Theme.getFont("small")
  117. wrapMode: Text.WordWrap
  118. width: parent.width
  119. // TODO: Add mail icon.
  120. }
  121. }
  122. }
  123. ScrollView
  124. {
  125. id: scroll
  126. frameVisible: true
  127. anchors
  128. {
  129. right: header.right
  130. top: header.bottom
  131. left: header.left
  132. bottom: base.bottom
  133. }
  134. height: parent.height
  135. style: UM.Theme.styles.scrollview
  136. /*
  137. ListView
  138. {
  139. id: contentColumn
  140. spacing: UM.Theme.getSize("base_unit").height
  141. height: childrenRect.height + (UM.Theme.getSize("double_margin").height * 2)
  142. anchors
  143. {
  144. left: scroll.left
  145. right: scroll.right
  146. top: scroll.top
  147. topMargin: UM.Theme.getSize("double_margin").height
  148. bottomMargin: UM.Theme.getSize("double_margin").height
  149. leftMargin: UM.Theme.getSize("double_margin").width
  150. rightMargin: UM.Theme.getSize("double_margin").width
  151. }
  152. ToolboxDetailTile {}
  153. ToolboxDetailTile {}
  154. ToolboxDetailTile {}
  155. ToolboxDetailTile {}
  156. ToolboxDetailTile {}
  157. ToolboxDetailTile {}
  158. ToolboxDetailTile {}
  159. ToolboxDetailTile {}
  160. ToolboxDetailTile {}
  161. ToolboxDetailTile {}
  162. ToolboxDetailTile {}
  163. }
  164. */
  165. }
  166. }