MonitorBuildplateConfiguration.qml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 2.0
  5. import UM 1.3 as UM
  6. /**
  7. * This component comprises a buildplate icon and the buildplate name. It is
  8. * used by the MonitorPrinterConfiguration component along with two instances
  9. * of MonitorExtruderConfiguration.
  10. *
  11. * NOTE: For most labels, a fixed height with vertical alignment is used to make
  12. * layouts more deterministic (like the fixed-size textboxes used in original
  13. * mock-ups). This is also a stand-in for CSS's 'line-height' property. Denoted
  14. * with '// FIXED-LINE-HEIGHT:'.
  15. */
  16. Item
  17. {
  18. // The buildplate name
  19. property alias buildplate: buildplateLabel.text
  20. // Height is one 18px label/icon
  21. height: 18 * screenScaleFactor // TODO: Theme!
  22. width: childrenRect.width
  23. Row
  24. {
  25. height: parent.height
  26. spacing: 12 * screenScaleFactor // TODO: Theme! (Should be same as extruder spacing)
  27. // This wrapper ensures that the buildplate icon is located centered
  28. // below an extruder icon.
  29. Item
  30. {
  31. height: parent.height
  32. width: 32 * screenScaleFactor // TODO: Theme! (Should be same as extruder icon width)
  33. UM.RecolorImage
  34. {
  35. id: buildplateIcon
  36. anchors.centerIn: parent
  37. color: "#0a0850" // TODO: Theme! (Standard purple)
  38. height: parent.height
  39. source: "../svg/icons/buildplate.svg"
  40. width: height
  41. }
  42. }
  43. Label
  44. {
  45. id: buildplateLabel
  46. color: "#191919" // TODO: Theme!
  47. elide: Text.ElideRight
  48. font: UM.Theme.getFont("very_small") // 12pt, regular
  49. text: ""
  50. // FIXED-LINE-HEIGHT:
  51. height: 18 * screenScaleFactor // TODO: Theme!
  52. verticalAlignment: Text.AlignVCenter
  53. }
  54. }
  55. }