Skip to content

Commit

Permalink
feat(WindowedFrame): reset keyboard focus and search text when hide
Browse files Browse the repository at this point in the history
当隐藏小启动器时,清除字母索引界面状态,清除键盘焦点,清除搜索状态。

Log:
  • Loading branch information
BLumia committed Nov 7, 2023
1 parent b81f89a commit c8feabc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions qml/WindowedFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ StackView {
focus: true

initialItem: Item {
id: baseLayer
objectName: "WindowedFrame-BaseLayer"

RowLayout {
anchors.fill: parent
anchors.topMargin: 20
Expand Down Expand Up @@ -300,4 +303,20 @@ StackView {
LauncherController.visible = false;
}
}

Connections {
target: LauncherController
function onVisibleChanged() {
// only do these clean-up steps on launcher get hide
if (LauncherController.visible) return
// exit from AlphabetCatalogy screen when
if (stackView.currentItem !== stackView.initialItem) {
stackView.pop()
}
// clear searchEdit text
searchEdit.text = ""
// reset(remove) keyboard focus
baseLayer.focus = true
}
}
}

0 comments on commit c8feabc

Please sign in to comment.