Select material from menu when user clicks on it

The main function of the menu, after all.

Contributes to issue CURA-8640.
This commit is contained in:
Ghostkeeper 2022-04-08 16:27:00 +02:00
parent 5df5d6c37d
commit 5a76cd1615
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -179,7 +179,9 @@ Cura.MenuItem
{
id: materialTypeButton
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton
onEntered:
{
@ -289,8 +291,17 @@ Cura.MenuItem
{
id: materialColorButton
anchors.fill: parent
hoverEnabled: true
hoverEnabled: true
onClicked:
{
Cura.MachineManager.setMaterial(extruderIndex, model.container_node);
menuPopup.itemHovered = 0; //Close all of these menus.
menuPopup.close();
colorPopup.itemHovered = 0;
colorPopup.close();
materialMenu.close();
}
onEntered:
{
menuPopup.itemHovered += 1;