Skip to content

Commit

Permalink
Fix unit system change in the units FirstRunPrompt
Browse files Browse the repository at this point in the history
When changing unit system, the individual unit ComboBoxes weren't
updating to reflect it. Fixed by forcing a model reload.
  • Loading branch information
rubenp02 authored and DonLakeFlyer committed Jan 3, 2025
1 parent 397fac3 commit 7bf3d0b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ FirstRunPrompt {
}

function changeSystemOfUnits(metric) {
// Hack to force reload the ComboBoxes, otherwise they don't update
unitComboBoxRepeater.model = 0
unitComboBoxRepeater.model = _rgFacts.length

if (_unitsSettings.horizontalDistanceUnits.visible) {
_unitsSettings.horizontalDistanceUnits.value = metric ? UnitsSettings.HorizontalDistanceUnitsMeters : UnitsSettings.HorizontalDistanceUnitsFeet
}
Expand Down Expand Up @@ -100,6 +104,7 @@ FirstRunPrompt {
}

Repeater {
id: unitComboBoxRepeater
model: _rgFacts.length
FactComboBox {
Layout.fillWidth: true
Expand Down

0 comments on commit 7bf3d0b

Please sign in to comment.