mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Add list of open file providers to submenu
The layout isn't quite there yet, but it mostly works and I want to have a save point to return to if I tinker too much. Contributes to issue CURA-8008.
This commit is contained in:
parent
0db1f1034b
commit
f8aa6a3398
1 changed files with 43 additions and 0 deletions
|
@ -131,6 +131,49 @@ Item
|
||||||
width: contentWidth
|
width: contentWidth
|
||||||
height: contentHeight
|
height: contentHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Repeater
|
||||||
|
{
|
||||||
|
model: prepareMenu.fileProviderModel
|
||||||
|
delegate: Button
|
||||||
|
{
|
||||||
|
leftPadding: UM.Theme.getSize("thick_margin").width
|
||||||
|
rightPadding: UM.Theme.getSize("thick_margin").width
|
||||||
|
width: contentItem.width + leftPadding + rightPadding
|
||||||
|
height: UM.Theme.getSize("action_button").height
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
contentItem: Label
|
||||||
|
{
|
||||||
|
text: model.displayText
|
||||||
|
color: UM.Theme.getColor("text")
|
||||||
|
font: UM.Theme.getFont("medium")
|
||||||
|
renderType: Text.NativeRendering
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
||||||
|
width: contentWidth
|
||||||
|
height: contentHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked:
|
||||||
|
{
|
||||||
|
if(model.index == 0) //The 0th element is the "From Disk" option, which should activate the open local file dialog.
|
||||||
|
{
|
||||||
|
Cura.Actions.open.trigger();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prepareMenu.fileProviderModel.trigger(model.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
background: Rectangle
|
||||||
|
{
|
||||||
|
color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent"
|
||||||
|
radius: UM.Theme.getSize("action_button_radius").width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue