Allow buttons to be passed in for drop down.

The change also remove the "Add Printer" and "Manage Printer" buttons from the monitor page drop down.

CURA-9424
This commit is contained in:
Joey de l'Arago 2022-11-04 15:37:57 +01:00
parent 2019d8f3af
commit ccb4d181e6
2 changed files with 56 additions and 33 deletions

View file

@ -57,6 +57,41 @@ Item
Layout.fillHeight: true
machineListModel: Cura.MachineListModel {}
buttons: [
Cura.SecondaryButton
{
id: addPrinterButton
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@button", "Add printer")
// The maximum width of the button is half of the total space, minus the padding of the parent, the left
// padding of the component and half the spacing because of the space between buttons.
fixedWidthMode: true
width: parent.width / 2 - leftPadding * 1.5
onClicked:
{
toggleContent()
Cura.Actions.addMachine.trigger()
}
},
Cura.SecondaryButton
{
id: managePrinterButton
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@button", "Manage printers")
fixedWidthMode: true
// The maximum width of the button is half of the total space, minus the padding of the parent, the right
// padding of the component and half the spacing because of the space between buttons.
width: parent.width / 2 - rightPadding * 1.5
onClicked:
{
toggleContent()
Cura.Actions.configureMachines.trigger()
}
}
]
}
Cura.ConfigurationMenu