on xenial help sign in
hide OSK (unfocus search) when opening a preview

fix issue if ScopeView.height > ScopeView.contentHeight

commitd5f8ac278a1c2e1bd8b9d53dceb5356f97a8fa74 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 18 Oct 2013, 11:12 (13 years ago) parent71b6681
2 files changed+7−3
Components/PageHeader.qml+4 Dash/GenericScopeView.qml+3−3
Components/PageHeader.qml+4
@@ -48,6 +48,10 @@ Item {
4848 searchField.focus = false;
4949 }
5050
51+ function unfocus() {
52+ searchField.focus = false;
53+ }
54+
5155 Connections {
5256 target: greeter
5357 onShownChanged: if (shown) resetSearch()
Dash/GenericScopeView.qml+3−3
@@ -388,7 +388,6 @@ ScopeView {
388388 }
389389
390390 if (open) {
391− print("switching to new index", currentIndex)
392391 categoryDelegate.highlightIndex = currentIndex
393392 }
394393
@@ -404,13 +403,13 @@ ScopeView {
404403 effectAdjust += newContentY;
405404 newContentY = 0;
406405 }
407− if (newContentY > categoryView.contentHeight - categoryView.height) {
406+ if (newContentY > Math.max(0, categoryView.contentHeight - categoryView.height)) {
408407 effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY
409408 newContentY = categoryView.contentHeight - categoryView.height;
410409 }
411410
412411 effect.positionPx = effectAdjust;
413− categoryView.contentY = newContentY;
412+ categoryView.contentY = newContentY - categoryView.originY;
414413 }
415414
416415 property bool open: false
@@ -420,6 +419,7 @@ ScopeView {
420419 if (open) {
421420 onScreen = true;
422421 categoryDelegate.highlightIndex = currentIndex;
422+ pageHeader.unfocus();
423423 } else {
424424 // Cancel any pending preview requests or actions
425425 if (previewListView.currentItem.previewData !== undefined) {