mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-19 20:57:49 -06:00
Update menu for PrinterType button
CURA-8683
This commit is contained in:
parent
b30ad58f91
commit
f8906597e5
2 changed files with 9 additions and 11 deletions
|
@ -64,17 +64,18 @@ Item
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
OldControls.ToolButton
|
Button
|
||||||
{
|
{
|
||||||
id: printerTypeSelector
|
id: printerTypeSelector
|
||||||
text: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.name: ""
|
text: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.name: ""
|
||||||
tooltip: text
|
|
||||||
height: UM.Theme.getSize("print_setup_big_item").height
|
height: UM.Theme.getSize("print_setup_big_item").height
|
||||||
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width
|
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
style: UM.Theme.styles.print_setup_header_button
|
onClicked: menu.open()
|
||||||
|
//style: UM.Theme.styles.print_setup_header_button
|
||||||
|
|
||||||
menu: Cura.PrinterTypeMenu { }
|
Cura.PrinterTypeMenu { id: menu}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 2.4
|
||||||
|
|
||||||
import UM 1.3 as UM
|
import UM 1.5 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
Menu
|
Menu
|
||||||
|
@ -18,12 +18,11 @@ Menu
|
||||||
id: printerTypeInstantiator
|
id: printerTypeInstantiator
|
||||||
model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : []
|
model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : []
|
||||||
|
|
||||||
MenuItem
|
UM.MenuItem
|
||||||
{
|
{
|
||||||
text: modelData.machine_type
|
text: modelData.machine_type
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: Cura.MachineManager.activeMachine.definition.name == modelData.machine_type
|
checked: Cura.MachineManager.activeMachine.definition.name == modelData.machine_type
|
||||||
exclusiveGroup: group
|
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
Cura.MachineManager.switchPrinterType(modelData.machine_type)
|
Cura.MachineManager.switchPrinterType(modelData.machine_type)
|
||||||
|
@ -32,6 +31,4 @@ Menu
|
||||||
onObjectAdded: menu.insertItem(index, object)
|
onObjectAdded: menu.insertItem(index, object)
|
||||||
onObjectRemoved: menu.removeItem(object)
|
onObjectRemoved: menu.removeItem(object)
|
||||||
}
|
}
|
||||||
|
|
||||||
ExclusiveGroup { id: group }
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue