forked from Shinonome/dots-hyprland
Switch from DropdownButton to StyledComboBox
This commit is contained in:
@@ -128,7 +128,7 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentSection {
|
ContentSection {
|
||||||
icon: "language"
|
icon: "language"
|
||||||
title: Translation.tr("Language")
|
title: Translation.tr("Language")
|
||||||
@@ -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,14 +152,26 @@ 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 {
|
||||||
title: Translation.tr("Generate translation with Gemini")
|
title: Translation.tr("Generate translation with Gemini")
|
||||||
tooltip: Translation.tr("You'll need to enter your Gemini API key first.\nType /key on the sidebar for instructions.")
|
tooltip: Translation.tr("You'll need to enter your Gemini API key first.\nType /key on the sidebar for instructions.")
|
||||||
|
|
||||||
ConfigRow {
|
ConfigRow {
|
||||||
MaterialTextArea {
|
MaterialTextArea {
|
||||||
id: localeInput
|
id: localeInput
|
||||||
@@ -196,7 +206,7 @@ ContentPage {
|
|||||||
ContentSubsectionLabel {
|
ContentSubsectionLabel {
|
||||||
text: Translation.tr("AI")
|
text: Translation.tr("AI")
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigSelectionArray {
|
ConfigSelectionArray {
|
||||||
currentValue: Config.options.policies.ai
|
currentValue: Config.options.policies.ai
|
||||||
onSelected: newValue => {
|
onSelected: newValue => {
|
||||||
@@ -279,7 +289,7 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentSection {
|
ContentSection {
|
||||||
icon: "nest_clock_farsight_analog"
|
icon: "nest_clock_farsight_analog"
|
||||||
title: Translation.tr("Time")
|
title: Translation.tr("Time")
|
||||||
@@ -310,7 +320,6 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Config.options.time.format = newValue;
|
Config.options.time.format = newValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user