[plasma/plasma-setup] /: Focus language search field when opening language page
Tiziano Gaia <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit d3d87b24a274841e89c7a153579cbb96c5f33c41 by Tiziano Gaia.
Committed on 19/07/2026 at 20:42.
Pushed by silverhadch into branch 'master'.
Focus language search field when opening language page
M +4 -0 modules/language/contents/ui/main.qml
M +11 -4 src/qml/Wizard.qml
https://invent.kde.org/plasma/plasma-setup/-/commit/d3d87b24a274841e89c7a153579cbb96c5f33c41
diff --git a/modules/language/contents/ui/main.qml b/modules/language/contents/ui/main.qml
index ea4bc36..3d7f767 100644
--- a/modules/language/contents/ui/main.qml
+++ b/modules/language/contents/ui/main.qml
@@ -22,6 +22,10 @@ import org.kde.plasmasetup.components as PlasmaSetupComponents
PlasmaSetupComponents.SetupModule {
id: root
+ function onPageActivated(): void {
+ searchField.forceActiveFocus();
+ }
+
contentItem: ColumnLayout {
id: mainColumn
diff --git a/src/qml/Wizard.qml b/src/qml/Wizard.qml
index 79fb025..c1c7616 100644
--- a/src/qml/Wizard.qml
+++ b/src/qml/Wizard.qml
@@ -77,6 +77,12 @@ Kirigami.Page {
InitialStartUtil.finish();
}
+ function activatePage(item): void {
+ if (item && item.module && typeof item.module.onPageActivated === "function") {
+ item.module.onPageActivated();
+ }
+ }
+
function requestNextPage(): void {
if (previousStepAnim.running || currentStepAnim.running || nextStepAnim.running) {
return;
@@ -91,10 +97,7 @@ Kirigami.Page {
// This allows the module to perform any necessary setup, and check if
// any data it relies on has been updated since the last activation.
if (currentIndex + 1 < stepCount) {
- let nextItem = stepsRepeater.itemAt(currentIndex + 1);
- if (nextItem && nextItem.module && typeof nextItem.module.onPageActivated === "function") {
- nextItem.module.onPageActivated();
- }
+ activatePage(stepsRepeater.itemAt(currentIndex + 1));
}
currentIndex++;
@@ -123,6 +126,8 @@ Kirigami.Page {
currentIndex--;
stepHeading.changeText(currentStepItem.name);
+ activatePage(stepsRepeater.itemAt(currentIndex));
+
currentStepItemX = -root.width;
currentStepItem.visible = true;
@@ -145,6 +150,8 @@ Kirigami.Page {
onRequestNextPage: {
root.showingLanding = false;
stepHeading.changeText(root.currentStepItem.name);
+
+ activatePage(root.currentStepItem);
}
}