PrinterTypeLabel.qml 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Controls 2.1
  5. import UM 1.5 as UM
  6. // This component creates a label with the abbreviated name of a printer, with a rectangle surrounding the label.
  7. // It is created in a separated place in order to be reused whenever needed.
  8. Item
  9. {
  10. property alias text: printerTypeLabel.text
  11. property bool autoFit: false
  12. width: autoFit ? (printerTypeLabel.width + UM.Theme.getSize("default_margin").width) : UM.Theme.getSize("printer_type_label").width
  13. height: UM.Theme.getSize("printer_type_label").height
  14. Rectangle
  15. {
  16. anchors.fill: parent
  17. color: UM.Theme.getColor("printer_type_label_background")
  18. radius: UM.Theme.getSize("checkbox_radius").width
  19. }
  20. UM.Label
  21. {
  22. id: printerTypeLabel
  23. text: "CFFFP" // As an abbreviated name of the Custom FFF Printer
  24. anchors.verticalCenter: parent.verticalCenter
  25. anchors.horizontalCenter: parent.horizontalCenter
  26. }
  27. }