Apply suggestions from code review

This commit is contained in:
Jelle Spijker 2022-12-08 07:43:57 +01:00 committed by GitHub
parent bcdfa808a8
commit 91170e0aef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 6 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) 2022 UltiMaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10

View File

@ -22,7 +22,8 @@ Cura.ComboBox {
// This is only used if updateAllExtruders == true
property int defaultExtruderIndex: 0
model: ListModel {
model: ListModel
{
id: comboboxModel
// The propertyProvider has not loaded the setting when this components onComplete triggers. Populating the model

View File

@ -62,8 +62,14 @@ RowLayout
Connections
{
target: propertyProvider
function onContainerStackChanged() { updateTimer.restart() }
function onIsValueUsedChanged() { updateTimer.restart() }
function onContainerStackChanged()
{
comboboxModel.updateModel()
}
function onIsValueUsedChanged()
{
comboboxModel.updateModel()
}
}
// Updates to the setting are delayed by interval. This reduces lag by waiting a bit after a setting change to update the slider contents.

View File

@ -59,8 +59,14 @@ UM.TextField
Connections
{
target: propertyProvider
function onContainerStackChanged() { updateTimer.restart() }
function onIsValueUsedChanged() { updateTimer.restart() }
function onContainerStackChanged()
{
updateTimer.restart()
}
function onIsValueUsedChanged()
{
updateTimer.restart()
}
}
// Restart update timer right after releasing a key. This stops lag while typing, but you still get warning and error