mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 05:53:59 -06:00
Fix the simulation view not being selected as default
CURA-6028
This commit is contained in:
parent
c4700b2752
commit
1b3cb32334
1 changed files with 16 additions and 9 deletions
|
@ -14,24 +14,31 @@ Cura.ExpandablePopup
|
|||
contentPadding: UM.Theme.getSize("default_lining").width
|
||||
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
|
||||
|
||||
property var viewModel: UM.ViewModel { }
|
||||
|
||||
property var activeView:
|
||||
property var viewModel: UM.ViewModel
|
||||
{
|
||||
for (var i = 0; i < viewModel.count; i++)
|
||||
onDataChanged: updateActiveView()
|
||||
}
|
||||
|
||||
|
||||
property var activeView: null
|
||||
|
||||
function updateActiveView()
|
||||
{
|
||||
for (var index in viewModel.items)
|
||||
{
|
||||
if (viewModel.items[i].active)
|
||||
|
||||
if (viewModel.items[index].active)
|
||||
{
|
||||
return viewModel.items[i]
|
||||
activeView = viewModel.items[index]
|
||||
return
|
||||
}
|
||||
}
|
||||
return null
|
||||
activeView = null
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
// Nothing was active, so just return the first one (the list is sorted by priority, so the most
|
||||
// important one should be returned)
|
||||
updateActiveView()
|
||||
if (activeView == null)
|
||||
{
|
||||
UM.Controller.setActiveView(viewModel.getItem(0).id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue