fix: fix language list view scrollbar and binding loop

This commit is contained in:
Jonathan Rainville 2021-03-25 15:01:59 -04:00 committed by Iuri Matias
parent 3813a1a330
commit 012b5dc8a0
1 changed files with 7 additions and 9 deletions

View File

@ -18,39 +18,37 @@ ModalPopup {
Item {
anchors.fill: parent
ButtonGroup {
id: languageGroup
}
ScrollView {
width: parent.width
anchors.top: parent.top
anchors.topMargin: Style.current.padding
anchors.bottom: parent.bottom
anchors.bottomMargin: Style.current.bigPadding
anchors.left: parent.left
anchors.leftMargin: 16
anchors.right: parent.right
anchors.rightMargin: 16
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
clip: true
ButtonGroup {
id: languageGroup
}
ListView {
id: languagesListView
anchors.fill: parent
anchors.rightMargin: Style.current.padding
anchors.leftMargin: Style.current.padding
model: Locales_JSON.locales
spacing: 0
delegate: Component {
StatusRadioButtonRow {
height: 64
anchors.rightMargin: 0
text: modelData.name
buttonGroup: languageGroup
checked: appSettings.locale === modelData.locale
onRadioCheckedChanged: {
if (checked) {
if (checked && appSettings.locale !== modelData.locale) {
profileModel.changeLocale(modelData.locale)
appSettings.locale = modelData.locale
}