settings: make language selection notice more material

This commit is contained in:
end-4
2025-08-26 08:49:46 +07:00
parent e6bb1a3fde
commit 485dd2952e
@@ -269,7 +269,7 @@ ContentPage {
ContentSubsection { ContentSubsection {
title: Translation.tr("Tray") title: Translation.tr("Tray")
ConfigSwitch { ConfigSwitch {
text: Translation.tr('Tint icons') text: Translation.tr('Tint icons')
checked: Config.options.bar.tray.monochromeIcons checked: Config.options.bar.tray.monochromeIcons
@@ -463,9 +463,10 @@ ContentPage {
StyledToolTip { StyledToolTip {
content: Translation.tr("Such regions could be images or parts of the screen that have some containment.\nMight not always be accurate.\nThis is done with an image processing algorithm run locally and no AI is used.") content: Translation.tr("Such regions could be images or parts of the screen that have some containment.\nMight not always be accurate.\nThis is done with an image processing algorithm run locally and no AI is used.")
} }
} }
} }
ContentSection {
ContentSection {
title: Translation.tr("Language") title: Translation.tr("Language")
ContentSubsection { ContentSubsection {
@@ -487,15 +488,18 @@ ContentPage {
value: "auto" value: "auto"
} }
]; ];
// Generate language options from available languages // Generate language options from available languages
// Intl.DisplayNames is not used. Show the language code with underscore replaced by hyphen. // Intl.DisplayNames is not used. Show the language code with underscore replaced by hyphen.
for (var i = 0; i < Translation.availableLanguages.length; i++) { for (var i = 0; i < Translation.availableLanguages.length; i++) {
var lang = Translation.availableLanguages[i]; var lang = Translation.availableLanguages[i];
var displayName = lang.replace('_', '-'); var displayName = lang.replace('_', '-');
baseOptions.push({ displayName: displayName, value: lang }); baseOptions.push({
displayName: displayName,
value: lang
});
} }
return baseOptions; return baseOptions;
} }
} }
@@ -503,32 +507,33 @@ ContentPage {
Rectangle { Rectangle {
id: reloadNotice id: reloadNotice
visible: false visible: false
Layout.fillWidth: true
Layout.topMargin: 8 Layout.topMargin: 8
height: noticeText.implicitHeight + 16
radius: 8 radius: 8
color: Appearance.m3colors.m3secondaryContainer color: Appearance.colors.colPrimaryContainer
border.color: Appearance.m3colors.m3outline Layout.fillWidth: true
border.width: 1 implicitWidth: languageRowLayout.implicitWidth + languageRowLayout.anchors.margins * 2
implicitHeight: languageRowLayout.implicitHeight + languageRowLayout.anchors.margins * 2
Row { RowLayout {
id: languageRowLayout
anchors.fill: parent anchors.fill: parent
anchors.margins: 8 anchors.margins: 8
spacing: 8 spacing: 8
MaterialSymbol { MaterialSymbol {
anchors.verticalCenter: parent.verticalCenter Layout.fillWidth: false
Layout.alignment: Qt.AlignVCenter
text: "info" text: "info"
iconSize: 20 iconSize: Appearance.font.pixelSize.larger
color: Appearance.m3colors.m3onSecondaryContainer color: Appearance.colors.colOnPrimaryContainer
} }
StyledText { StyledText {
id: noticeText id: noticeText
anchors.verticalCenter: parent.verticalCenter Layout.fillWidth: true
width: parent.width - 36 Layout.alignment: Qt.AlignVCenter
text: Translation.tr("Language setting saved. Please restart the quickshell to apply the new language.") text: Translation.tr("Language setting saved. Please restart Quickshell (Ctrl+Super+R) to apply the new language.")
color: Appearance.m3colors.m3onSecondaryContainer color: Appearance.colors.colOnPrimaryContainer
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }