Switch from DropdownButton to StyledComboBox

This commit is contained in:
Pico
2025-11-08 20:12:30 +03:00
parent 8b5a783c1f
commit c7c38bf0b1
@@ -137,14 +137,12 @@ ContentPage {
title: Translation.tr("Interface Language") title: Translation.tr("Interface Language")
tooltip: Translation.tr("Select the language for the user interface.\n\"Auto\" will use your system's locale.") tooltip: Translation.tr("Select the language for the user interface.\n\"Auto\" will use your system's locale.")
DropdownButton { StyledComboBox {
id: languageSelector id: languageSelector
buttonIcon: "language" buttonIcon: "language"
currentValue: Config.options.language.ui textRole: "displayName"
onSelected: newValue => {
Config.options.language.ui = newValue; model: [
}
options: [
{ {
displayName: Translation.tr("Auto (System)"), displayName: Translation.tr("Auto (System)"),
value: "auto" value: "auto"
@@ -154,8 +152,20 @@ ContentPage {
displayName: lang, displayName: lang,
value: lang value: lang
}; };
}) })]
]
Component.onCompleted: {
for (let i = 0; i < model.length; i++) {
if (model[i].value === Config.options.language.ui) {
currentIndex = i;
break;
}
}
}
onActivated: index => {
Config.options.language.ui = model[index].value;
}
} }
} }
ContentSubsection { ContentSubsection {
@@ -310,7 +320,6 @@ ContentPage {
} }
Config.options.time.format = newValue; Config.options.time.format = newValue;
} }
options: [ options: [
{ {