Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-docviewer-app/fix-documents-page-keyboard into lp:ubuntu-docviewer-app.
Commit message: Fixed the keyboard input issues in DocumentsPage, caused by the migration to the new PageHeader component. In particular: * OSK visible on app start-up * It was possible to type chars into the searchField (and then filter the document entries out) even if the searchFiled was not visible * OSK still visible after the search header was closed (through the 'Cancel' button) Requested reviews: Ubuntu Document Viewer Developers (ubuntu-docviewer-dev) Related bugs: Bug #1566899 in Ubuntu Document Viewer App: "OSK appears on app startup" https://bugs.launchpad.net/ubuntu-docviewer-app/+bug/1566899 Bug #1566902 in Ubuntu Document Viewer App: "OSK does not not automatically hide after pressing the cancel button" https://bugs.launchpad.net/ubuntu-docviewer-app/+bug/1566902 For more details, see: https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/fix-documents-page-keyboard/+merge/291139 Fixed the keyboard input issues in DocumentsPage, caused by the migration to the new PageHeader component. In particular: * OSK visible on app start-up * It was possible to type chars into the searchField (and then filter the document entries out) even if the searchFiled was not visible * OSK still visible after the search header was closed (through the 'Cancel' button) -- Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/fix-documents-page-keyboard into lp:ubuntu-docviewer-app.
=== modified file 'src/app/qml/documentPage/DocumentPage.qml' --- src/app/qml/documentPage/DocumentPage.qml 2016-03-03 13:17:53 +0000 +++ src/app/qml/documentPage/DocumentPage.qml 2016-04-06 16:24:27 +0000 @@ -33,6 +33,17 @@ docModel.checkDefaultDirectories(); } + Component.onCompleted: { + // WORKAROUND: We need to explicitely force the focus in order to avoid + // that the TextField in DocumentPageSearchHeader is focused even if that + // header is not visible. + // With the deprecated UITK 1.2 PageHeadState this was not required since + // the header content was "loaded" by demand. + // With the new UITK 1.3 PageHeader, all the headers are always initialized, + // so we need to put some extra care. + scrollView.forceActiveFocus() + } + ScrollView { id: scrollView anchors.fill: parent @@ -69,6 +80,20 @@ DocumentPageSearchHeader { id: searchHeader visible: !mainView.pickMode && !view.ViewItems.selectMode && documentPage.searchMode + + onVisibleChanged: { + // WORKAROUND: We need to explicitely force the focus in order to avoid + // that the TextField in DocumentPageSearchHeader is focused even if that + // header is not visible. + // With the deprecated UITK 1.2 PageHeadState this was not required since + // the header content was "loaded" by demand. + // With the new UITK 1.3 PageHeader, all the headers are always initialized, + // so we need to put some extra care. + if (visible) + textField.forceActiveFocus() + else + scrollView.forceActiveFocus() + } } DocumentPageSelectionModeHeader { === modified file 'src/app/qml/documentPage/DocumentPageSearchHeader.qml' --- src/app/qml/documentPage/DocumentPageSearchHeader.qml 2016-03-30 10:43:02 +0000 +++ src/app/qml/documentPage/DocumentPageSearchHeader.qml 2016-04-06 16:24:27 +0000 @@ -25,6 +25,8 @@ property var view: parent.view property Page parentPage: parent + property alias textField: searchField + trailingActionBar { anchors.rightMargin: 0 delegate: TextualButtonStyle {}
-- Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers More help : https://help.launchpad.net/ListHelp