WorkspaceRow.qml 987 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (c) 2022 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import QtQuick.Layouts 1.3
  6. import QtQuick.Window 2.2
  7. import UM 1.5 as UM
  8. import Cura 1.1 as Cura
  9. RowLayout
  10. {
  11. id: root
  12. property alias leftLabelText: leftLabel.text
  13. property alias rightLabelText: rightLabel.text
  14. property alias buttonText: button.text
  15. signal buttonClicked
  16. width: parent.width
  17. UM.Label
  18. {
  19. id: leftLabel
  20. text: catalog.i18nc("@action:label", "Type")
  21. Layout.preferredWidth: Math.round(parent.width / 4)
  22. wrapMode: Text.WordWrap
  23. }
  24. UM.Label
  25. {
  26. id: rightLabel
  27. text: manager.machineType
  28. wrapMode: Text.WordWrap
  29. }
  30. Cura.TertiaryButton
  31. {
  32. id: button
  33. visible: !text.isEmpty
  34. Layout.maximumHeight: leftLabel.implicitHeight
  35. Layout.fillWidth: true
  36. onClicked: root.buttonClicked()
  37. }
  38. }