status-desktop/ui/app/AppLayouts/Profile/Sections/LanguageModal.qml

64 lines
1.8 KiB
QML
Raw Normal View History

2021-03-24 16:28:59 +00:00
import QtQuick 2.13
import QtQuick.Controls 2.13
import "../../../../imports"
import "../../../../shared"
import "../../../../shared/status"
import "./Data/locales.js" as Locales_JSON
ModalPopup {
id: popup
//% "Language"
title: qsTrId("Language")
onClosed: {
destroy()
}
2021-03-25 18:22:04 +00:00
Item {
anchors.fill: parent
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
}
2021-03-24 16:28:59 +00:00
2021-03-25 18:22:04 +00:00
ListView {
id: languagesListView
anchors.fill: parent
anchors.rightMargin: Style.current.padding
model: Locales_JSON.locales
spacing: 0
delegate: Component {
StatusRadioButtonRow {
height: 64
text: modelData.name
buttonGroup: languageGroup
checked: appSettings.locale === modelData.locale
onRadioCheckedChanged: {
if (checked) {
profileModel.changeLocale(modelData.locale)
appSettings.locale = modelData.locale
}
}
2021-03-24 16:28:59 +00:00
}
}
}
}
}
}