MonitorItem.qml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) 2017 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Controls.Styles 1.1
  6. import QtQuick.Layouts 1.1
  7. import UM 1.2 as UM
  8. import Cura 1.0 as Cura
  9. Item
  10. {
  11. property string label: ""
  12. property string value: ""
  13. height: childrenRect.height;
  14. Row
  15. {
  16. height: UM.Theme.getSize("setting_control").height
  17. width: Math.floor(base.width - 2 * UM.Theme.getSize("default_margin").width)
  18. anchors.left: parent.left
  19. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  20. Label
  21. {
  22. width: Math.floor(parent.width * 0.4)
  23. anchors.verticalCenter: parent.verticalCenter
  24. text: label
  25. color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
  26. font: UM.Theme.getFont("default")
  27. elide: Text.ElideRight
  28. }
  29. Label
  30. {
  31. width: Math.floor(parent.width * 0.6)
  32. anchors.verticalCenter: parent.verticalCenter
  33. text: value
  34. color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
  35. font: UM.Theme.getFont("default")
  36. elide: Text.ElideRight
  37. }
  38. }
  39. }