Merge lp:~aacid/unity8/scope_settings_keyboard_scroll into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Terry
Approved revision: 2006
Merged at revision: 2026
Proposed branch: lp:~aacid/unity8/scope_settings_keyboard_scroll
Merge into: lp:unity8
Prerequisite: lp:~cimi/unity8/wide-preview-zoomable-videoplayback
Diff against target: 192 lines (+90/-16)
6 files modified
qml/Components/ListViewOSKScroller.qml (+53/-0)
qml/Dash/Previews/Preview.qml (+9/-16)
qml/Dash/ScopeSettings/ScopeSetting.qml (+9/-0)
qml/Dash/ScopeSettings/ScopeSettingString.qml (+6/-0)
qml/Dash/ScopeSettings/ScopeSettingsWidgetFactory.qml (+4/-0)
qml/Dash/ScopeSettingsPage.qml (+9/-0)
To merge this branch: bzr merge lp:~aacid/unity8/scope_settings_keyboard_scroll
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michael Terry Approve
Review via email: mp+275723@code.launchpad.net

This proposal supersedes a proposal from 2015-10-19.

Commit message

Make the scope settings list scroll to text visible area

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2005
http://jenkins.qa.ubuntu.com/job/unity8-ci/6487/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4700
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/869
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1199
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/515
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1094
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1095
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/726
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/727
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3793
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4697
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4697/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24334
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/513
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/869
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/869/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24335

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6487/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

We talked a while on IRC about some nitpicks I had with the code you moved. But you disagreed and it's code you are merely moving, so I won't press the issue.

 * Did you perform an exploratory manual test run of the code change and any related functionality?
 Yup, works great.

 * Did CI run pass? If not, please explain why.
 No, for unrelated reasons.

 * Did you make sure that the branch does not contain spurious tags?
 Yes

review: Approve
Revision history for this message
Michael Terry (mterry) wrote :

Still good.

review: Approve
Revision history for this message
Michał Sawicz (saviq) wrote :

/«BUILDDIR»/unity8-8.11+16.04.20151026/qml/Components/ListViewOSKScroller.qml: bad import version in line 17

2007. By Albert Astals Cid

Move to 2.4

Revision history for this message
Albert Astals Cid (aacid) wrote :

> /«BUILDDIR»/unity8-8.11+16.04.20151026/qml/Components/ListViewOSKScroller.qml:
> bad import version in line 17

Done

2008. By Albert Astals Cid

Merge wide-preview-zoomable-videoplayback

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'qml/Components/ListViewOSKScroller.qml'
2--- qml/Components/ListViewOSKScroller.qml 1970-01-01 00:00:00 +0000
3+++ qml/Components/ListViewOSKScroller.qml 2015-10-27 11:57:54 +0000
4@@ -0,0 +1,53 @@
5+/*
6+ * Copyright (C) 2015 Canonical, Ltd.
7+ *
8+ * This program is free software; you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License as published by
10+ * the Free Software Foundation; version 3.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU General Public License
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19+ */
20+
21+import QtQuick 2.4
22+import "../Components"
23+
24+Item {
25+ id: root
26+
27+ property ListView list
28+
29+ Binding {
30+ target: list
31+ property: "bottomMargin"
32+ value: d.bottomMargin
33+ }
34+
35+ function setMakeSureVisibleItem(item) {
36+ d.previousVisibleHeight = d.visibleHeight;
37+ d.makeSureVisibleItem = item;
38+ }
39+
40+ QtObject {
41+ id: d
42+ property var makeSureVisibleItem
43+ property real previousVisibleHeight: 0
44+ readonly property real visibleHeight: list.height - list.bottomMargin
45+ readonly property real bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
46+
47+ onVisibleHeightChanged: {
48+ if (makeSureVisibleItem && makeSureVisibleItem.activeFocus && previousVisibleHeight > visibleHeight) {
49+ var textAreaPos = makeSureVisibleItem.mapToItem(list, 0, 0);
50+ if (textAreaPos.y + makeSureVisibleItem.height > visibleHeight) {
51+ list.contentY += textAreaPos.y + makeSureVisibleItem.height - visibleHeight
52+ }
53+ }
54+ previousVisibleHeight = visibleHeight;
55+ }
56+ }
57+}
58
59=== modified file 'qml/Dash/Previews/Preview.qml'
60--- qml/Dash/Previews/Preview.qml 2015-10-27 11:57:54 +0000
61+++ qml/Dash/Previews/Preview.qml 2015-10-27 11:57:54 +0000
62@@ -16,6 +16,7 @@
63
64 import QtQuick 2.0
65 import Ubuntu.Components 1.3
66+import "../../Components"
67
68 /*! \brief This component constructs the Preview UI.
69 *
70@@ -72,18 +73,10 @@
71 }
72 width: row.columnWidth
73 spacing: row.spacing
74- bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
75- property var makeSureVisibleItem
76- property real previousVisibleHeight: 0
77- property real visibleHeight: height - bottomMargin
78- onVisibleHeightChanged: {
79- if (makeSureVisibleItem && makeSureVisibleItem.activeFocus && previousVisibleHeight > visibleHeight) {
80- var textAreaPos = makeSureVisibleItem.mapToItem(column, 0, 0);
81- if (textAreaPos.y + makeSureVisibleItem.height > column.visibleHeight) {
82- column.contentY += textAreaPos.y + makeSureVisibleItem.height - column.visibleHeight
83- }
84- }
85- previousVisibleHeight = visibleHeight;
86+
87+ ListViewOSKScroller {
88+ id: oskScroller
89+ list: column
90 }
91
92 model: columnModel
93@@ -107,10 +100,10 @@
94 onTriggered: {
95 previewModel.triggered(widgetId, actionId, data);
96 }
97- onMakeSureVisible: {
98- column.previousVisibleHeight=column.visibleHeight
99- column.makeSureVisibleItem=item
100- }
101+
102+ onMakeSureVisible: {
103+ oskScroller.setMakeSureVisibleItem(item);
104+ }
105
106 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
107
108
109=== modified file 'qml/Dash/ScopeSettings/ScopeSetting.qml'
110--- qml/Dash/ScopeSettings/ScopeSetting.qml 2015-10-27 11:57:54 +0000
111+++ qml/Dash/ScopeSettings/ScopeSetting.qml 2015-10-27 11:57:54 +0000
112@@ -32,6 +32,15 @@
113 */
114 signal updated(var value)
115
116+ /*! \brief This signal should be emitted when widget gains the focus
117+ * and input method popups.
118+ * And preview widget should reposition in visible area to avoid
119+ * keyboard appears over the widget.
120+ *
121+ * \param item, id of specified item which is needed to reposition.
122+ */
123+ signal makeSureVisible(var item)
124+
125 //! \internal
126 readonly property real settingMargins: units.gu(2)
127 }
128
129=== modified file 'qml/Dash/ScopeSettings/ScopeSettingString.qml'
130--- qml/Dash/ScopeSettings/ScopeSettingString.qml 2015-10-27 11:57:54 +0000
131+++ qml/Dash/ScopeSettings/ScopeSettingString.qml 2015-10-27 11:57:54 +0000
132@@ -78,6 +78,12 @@
133 updateText();
134 }
135 }
136+
137+ readonly property bool inputMethodVisible: Qt.inputMethod.visible
138+ onInputMethodVisibleChanged: {
139+ if(inputMethodVisible && activeFocus)
140+ root.makeSureVisible(control);
141+ }
142 }
143 }
144 }
145
146=== modified file 'qml/Dash/ScopeSettings/ScopeSettingsWidgetFactory.qml'
147--- qml/Dash/ScopeSettings/ScopeSettingsWidgetFactory.qml 2014-08-26 12:33:32 +0000
148+++ qml/Dash/ScopeSettings/ScopeSettingsWidgetFactory.qml 2015-10-27 11:57:54 +0000
149@@ -30,6 +30,9 @@
150 //! Triggered signal forwarded from the widgets.
151 signal updated(var value)
152
153+ //! makeSureVisible signal forwarded from the widgets.
154+ signal makeSureVisible(var item)
155+
156 source: widgetSource
157
158 //! \cond private
159@@ -53,5 +56,6 @@
160 Connections {
161 target: root.item
162 onUpdated: if (value !== widgetData.value) root.updated(value)
163+ onMakeSureVisible: root.makeSureVisible(item)
164 }
165 }
166
167=== modified file 'qml/Dash/ScopeSettingsPage.qml'
168--- qml/Dash/ScopeSettingsPage.qml 2015-10-27 11:57:54 +0000
169+++ qml/Dash/ScopeSettingsPage.qml 2015-10-27 11:57:54 +0000
170@@ -51,6 +51,11 @@
171 model: root.scope ? root.scope.settings : null
172 clip: true
173
174+ ListViewOSKScroller {
175+ id: oskScroller
176+ list: scopeSettings
177+ }
178+
179 delegate: ScopeSettingsWidgetFactory {
180 objectName: "scopeSettingItem" + index
181 width: root.width
182@@ -58,6 +63,10 @@
183 scopeStyle: root.scopeStyle
184
185 onUpdated: model.value = value;
186+
187+ onMakeSureVisible: { // var item
188+ oskScroller.setMakeSureVisibleItem(item);
189+ }
190 }
191 }
192 }

Subscribers

People subscribed via source and target branches