Skip to content

Commit

Permalink
Fix most other prompter/editor focus switching issues
Browse files Browse the repository at this point in the history
Fix #281
  • Loading branch information
Cuperino committed Sep 21, 2024
1 parent 40ebd37 commit 4117761
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/kirigami_ui/PrompterPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ Kirigami.Page {
Kirigami.Action {
id: promptingButton
text: i18n("Start prompter")
onTriggered: {
prompterPage.focus = true
prompter.toggle()
}
onTriggered: prompter.toggle()
},
Kirigami.Action {
id: decreaseVelocityButton
Expand Down
4 changes: 4 additions & 0 deletions src/prompter/Prompter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ Flickable {
}

function restoreFocus() {
prompterPage.focus = true
if (parseInt(state)===Prompter.States.Editing)
editor.focus = !root.__isMobile
else
Expand Down Expand Up @@ -314,6 +315,7 @@ Flickable {
//if (root.passiveNotifications)
// showPassiveNotification(i18n("Increase Velocity"));
}
prompter.restoreFocus()
}

function decreaseVelocity(event) {
Expand All @@ -328,6 +330,7 @@ Flickable {
//if (root.passiveNotifications)
// showPassiveNotification(i18n("Decrease Velocity"));
}
prompter.restoreFocus()
}

function editMarker(cursorPosition, fragmentLength) {
Expand Down Expand Up @@ -653,6 +656,7 @@ Flickable {

function toggleEditorFocus(mouse) {
if (!editor.activeFocus) {
prompter.restoreFocus();
editor.focus = true;
editor.cursorPosition = editor.positionAt(mouse.x, mouse.y)
cursorAutoHide.reset();
Expand Down

0 comments on commit 4117761

Please sign in to comment.