PrepareMenu.qml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import QtQuick 2.7
  2. import QtQuick.Controls 1.4
  3. import UM 1.3 as UM
  4. import Cura 1.1 as Cura
  5. Item
  6. {
  7. id: prepareMenu
  8. // This widget doesn't show tooltips by itself. Instead it emits signals so others can do something with it.
  9. signal showTooltip(Item item, point location, string text)
  10. signal hideTooltip()
  11. property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != ""
  12. property bool printerConnected: Cura.MachineManager.printerConnected
  13. UM.I18nCatalog
  14. {
  15. id: catalog
  16. name: "cura"
  17. }
  18. Row
  19. {
  20. anchors.horizontalCenter: parent.horizontalCenter
  21. Button
  22. {
  23. id: openFileButton
  24. text: catalog.i18nc("@action:button", "Open File")
  25. iconSource: UM.Theme.getIcon("load")
  26. style: UM.Theme.styles.tool_button
  27. tooltip: ""
  28. action: Cura.Actions.open
  29. }
  30. Item
  31. {
  32. id: spacing
  33. width: UM.Theme.getSize("default_margin").width
  34. height: prepareMenu.height
  35. }
  36. Cura.MachineSelector
  37. {
  38. id: machineSelection
  39. width: Math.round(0.8 * UM.Theme.getSize("sidebar").width) - configSelection.width
  40. height: prepareMenu.height
  41. }
  42. Cura.QuickConfigurationSelector
  43. {
  44. id: configSelection
  45. visible: isNetworkPrinter && printerConnected
  46. width: visible ? Math.round(UM.Theme.getSize("sidebar").width * 0.15) : 0
  47. panelWidth: Math.round(0.8 * UM.Theme.getSize("sidebar").width)
  48. height: prepareMenu.height
  49. }
  50. Cura.CustomConfigurationSelector
  51. {
  52. width: UM.Theme.getSize("sidebar").width
  53. }
  54. Cura.PrintSetupSelector
  55. {
  56. width: UM.Theme.getSize("sidebar").width
  57. onShowTooltip: prepareMenu.showTooltip(item, location, text)
  58. onHideTooltip: prepareMenu.hideTooltip()
  59. }
  60. }
  61. }