MachineAndConfigurationSelector.qml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright (c) 2017 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import UM 1.2 as UM
  5. import Cura 1.0 as Cura
  6. import "Menus"
  7. import "Menus/ConfigurationMenu"
  8. Rectangle
  9. {
  10. color: UM.Theme.getColor("sidebar_lining_thin")
  11. implicitHeight: UM.Theme.getSize("sidebar_header").height
  12. implicitWidth: UM.Theme.getSize("sidebar").width
  13. property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != ""
  14. property bool printerConnected: Cura.MachineManager.printerConnected
  15. MachineSelection
  16. {
  17. id: machineSelection
  18. anchors
  19. {
  20. left: parent.left
  21. right: configSelection.left
  22. rightMargin: UM.Theme.getSize("sidebar_lining_thin").height / 2
  23. top: parent.top
  24. bottom: parent.bottom
  25. }
  26. }
  27. ConfigurationSelection
  28. {
  29. id: configSelection
  30. visible: isNetworkPrinter && printerConnected
  31. width: visible ? Math.round(parent.width * 0.15) : 0
  32. panelWidth: parent.width
  33. anchors
  34. {
  35. right: parent.right
  36. top: parent.top
  37. bottom: parent.bottom
  38. }
  39. }
  40. }