mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-29 22:01:14 -07:00
Merge branch 'ui_rework_4_0' into cura4.0_header
This commit is contained in:
commit
54f32a1d82
10 changed files with 312 additions and 383 deletions
|
|
@ -110,24 +110,25 @@ UM.PreferencesPage
|
|||
right: parent.right
|
||||
}
|
||||
|
||||
model: settingVisibilityPresetsModel
|
||||
model: settingVisibilityPresetsModel.items
|
||||
textRole: "name"
|
||||
|
||||
currentIndex:
|
||||
{
|
||||
// Load previously selected preset.
|
||||
var index = settingVisibilityPresetsModel.find("id", settingVisibilityPresetsModel.activePreset)
|
||||
if (index == -1)
|
||||
for(var i = 0; i < settingVisibilityPresetsModel.items.length; ++i)
|
||||
{
|
||||
return 0
|
||||
if(settingVisibilityPresetsModel.items[i].id == settingVisibilityPresetsModel.activePreset)
|
||||
{
|
||||
currentIndex = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return index
|
||||
return -1
|
||||
}
|
||||
|
||||
onActivated:
|
||||
{
|
||||
var preset_id = settingVisibilityPresetsModel.getItem(index).id;
|
||||
var preset_id = settingVisibilityPresetsModel.items[index].id;
|
||||
settingVisibilityPresetsModel.setActivePreset(preset_id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue