on xenial help sign in
fix the focused window title string
45ffbccMichael Zanetti
qml/Shell.qml+4−1
@@ -271,6 +271,8 @@ StyledItem {
271 && launcher.progress == 0
271 && launcher.progress == 0
272 && !notifications.useModal
272 && !notifications.useModal
273
273
274+ onInteractiveChanged: { if (interactive) { focus = true; } }
275+
274 // TODO: This is not implemented yet in the new stage...
276 // TODO: This is not implemented yet in the new stage...
275 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
277 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
276 keepDashRunning: launcher.shown || launcher.dashSwipe
278 keepDashRunning: launcher.shown || launcher.dashSwipe
@@ -297,6 +299,7 @@ StyledItem {
297
299
298 Loader {
300 Loader {
299 id: greeterLoader
301 id: greeterLoader
302+ objectName: "greeterLoader"
300 anchors.fill: parent
303 anchors.fill: parent
301 anchors.topMargin: panel.panelHeight
304 anchors.topMargin: panel.panelHeight
302 sourceComponent: shell.mode != "shell" ? integratedGreeter :
305 sourceComponent: shell.mode != "shell" ? integratedGreeter :
@@ -499,7 +502,7 @@ StyledItem {
499 }
502 }
500 onFocusChanged: {
503 onFocusChanged: {
501 if (!focus) {
504 if (!focus) {
502− shell.focus = true;
505+ stages.focus = true;
503 }
506 }
504 }
507 }
505
508
qml/Stage/Spread/Spread.qml+6−2
@@ -6,8 +6,8 @@ Item {
6 id: root
6 id: root
7
7
8 // Information about the environment
8 // Information about the environment
9− property int totalItemCount: 0
10 property int highlightedIndex: 1
9 property int highlightedIndex: 1
10+ property var model: null
11
11
12 // some config options
12 // some config options
13 property real contentMargin: 0.16 * root.height
13 property real contentMargin: 0.16 * root.height
@@ -22,6 +22,7 @@ Item {
22
22
23
23
24 // Calculated stuff
24 // Calculated stuff
25+ readonly property int totalItemCount: model.count
25 readonly property real leftStackXPos: 0.03 * root.width
26 readonly property real leftStackXPos: 0.03 * root.width
26 readonly property real rightStackXPos: root.width - 1.5 * leftStackXPos
27 readonly property real rightStackXPos: root.width - 1.5 * leftStackXPos
27
28
@@ -89,9 +90,11 @@ Item {
89 y: windowTitleTopMargin
90 y: windowTitleTopMargin
90// //y: priv.spreadTopMargin + priv.contentTopMargin + settings.spreadOffset + settings.titleOffset - height - (priv.contentTopMargin - height) / 4
91// //y: priv.spreadTopMargin + priv.contentTopMargin + settings.spreadOffset + settings.titleOffset - height - (priv.contentTopMargin - height) / 4
91// visible: height < priv.contentTopMargin
92// visible: height < priv.contentTopMargin
92− text: "focused window title"
93+ text: root.highlightedIndex >= 0 && root.model ? root.model.surfaceAt(root.highlightedIndex).name : ""
93 fontSize: root.height < units.gu(85) ? 'medium' : 'large'
94 fontSize: root.height < units.gu(85) ? 'medium' : 'large'
94 color: "white"
95 color: "white"
96+ opacity: root.highlightedIndex >= 0 ? 1 : 0
97+ Behavior on opacity { UbuntuNumberAnimation { } }
95 }
98 }
96
99
97// Label {
100// Label {
@@ -105,6 +108,7 @@ Item {
105
108
106
109
107 Keys.onPressed: {
110 Keys.onPressed: {
111+ print("key pressed")
108 switch (event.key) {
112 switch (event.key) {
109 case Qt.Key_Left:
113 case Qt.Key_Left:
110 case Qt.Key_Backtab:
114 case Qt.Key_Backtab:
qml/Stage/Stage.qml+13−11
@@ -111,8 +111,7 @@ AbstractStage {
111
111
112 property var focusedAppDelegate: null
112 property var focusedAppDelegate: null
113 onFocusedAppDelegateChanged: {
113 onFocusedAppDelegateChanged: {
114− print("focusedAppDelegate changed", focusedAppDelegate.objectName)
115− if (root.state == "spread") {
114+ if (focusedAppDelegate && root.state == "spread") {
116 goneToSpread = false;
115 goneToSpread = false;
117 }
116 }
118 }
117 }
@@ -121,8 +120,8 @@ AbstractStage {
121
120
122 property bool goneToSpread: false
121 property bool goneToSpread: false
123 property int closingIndex: -1
122 property int closingIndex: -1
124− property int animationDuration: 4000
123+// property int animationDuration: 4000
125−// property int animationDuration: UbuntuAnimation.FastDuration
124+ property int animationDuration: UbuntuAnimation.FastDuration
126
125
127 function updateForegroundMaximizedApp() {
126 function updateForegroundMaximizedApp() {
128 var found = false;
127 var found = false;
@@ -172,7 +171,7 @@ AbstractStage {
172 }
171 }
173
172
174 function updateMainAndSideStageIndexes() {
173 function updateMainAndSideStageIndexes() {
175− print("updating stage indexes, sideStage shown:", sideStage.shown)
174+// print("updating stage indexes, sideStage shown:", sideStage.shown)
176 var choseMainStage = false;
175 var choseMainStage = false;
177 var choseSideStage = false;
176 var choseSideStage = false;
178
177
@@ -181,7 +180,6 @@ AbstractStage {
181
180
182 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
181 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
183 var appDelegate = appRepeater.itemAt(i);
182 var appDelegate = appRepeater.itemAt(i);
184− print("have app on stage", appDelegate.applicationId, appDelegate.stage)
185 if (/*sideStage.shown && */appDelegate.stage == ApplicationInfoInterface.SideStage
183 if (/*sideStage.shown && */appDelegate.stage == ApplicationInfoInterface.SideStage
186 && !choseSideStage) {
184 && !choseSideStage) {
187 priv.sideStageDelegate = appDelegate
185 priv.sideStageDelegate = appDelegate
@@ -332,11 +330,14 @@ AbstractStage {
332 },
330 },
333 Transition {
331 Transition {
334 from: "spread"
332 from: "spread"
333+ SequentialAnimation {
335− ScriptAction { script: {
334+ ScriptAction { script: {
336− var item = appRepeater.itemAt(spreadItem.highlightedIndex);
335+ var item = appRepeater.itemAt(spreadItem.highlightedIndex);
337− item.claimFocus();
336+ item.claimFocus();
338− item.playFocusAnimation();
337+ item.playFocusAnimation();
338+ }
339 }
339 }
340+ PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
340 }
341 }
341 },
342 },
342 Transition {
343 Transition {
@@ -365,7 +366,7 @@ AbstractStage {
365 Spread {
366 Spread {
366 id: spreadItem
367 id: spreadItem
367 anchors.fill: appContainer
368 anchors.fill: appContainer
368− totalItemCount: appRepeater.count
369+ model: root.topLevelSurfaceList
369 z: 10
370 z: 10
370 }
371 }
371
372
@@ -1306,6 +1307,7 @@ AbstractStage {
1306 gesturePoints = [];
1307 gesturePoints = [];
1307 } else {
1308 } else {
1308 if (gesturePoints[gesturePoints.length - 1] < -root.width * 0.4 ) {
1309 if (gesturePoints[gesturePoints.length - 1] < -root.width * 0.4 ) {
1310+ print("gone to spread true")
1309 priv.goneToSpread = true;
1311 priv.goneToSpread = true;
1310 } else {
1312 } else {
1311 if (appRepeater.count > 1) {
1313 if (appRepeater.count > 1) {
tests/qmltests/tst_Shell.qml+45−13
@@ -107,6 +107,7 @@ Rectangle {
107 sourceComponent: Component {
107 sourceComponent: Component {
108 Shell {
108 Shell {
109 id: __shell
109 id: __shell
110+ objectName: "shell"
110 usageScenario: usageScenarioSelector.model[usageScenarioSelector.selectedIndex]
111 usageScenario: usageScenarioSelector.model[usageScenarioSelector.selectedIndex]
111 nativeWidth: width
112 nativeWidth: width
112 nativeHeight: height
113 nativeHeight: height
@@ -183,22 +184,44 @@ Rectangle {
183 callManager.foregroundCall = callManager.foregroundCall ? null : phoneCall;
184 callManager.foregroundCall = callManager.foregroundCall ? null : phoneCall;
184 }
185 }
185 }
186 }
186− }
187− Button {
187+ Button {
188− text: "Show Launcher"
188+ text: "Show Launcher"
189− activeFocusOnPress: false
189+ activeFocusOnPress: false
190− onClicked: {
190+ onClicked: {
191− if (shellLoader.status !== Loader.Ready)
191+ if (shellLoader.status !== Loader.Ready)
192− return;
192+ return;
193
193
194− var launcher = testCase.findChild(shellLoader.item, "launcher");
194+ var launcher = testCase.findChild(shellLoader.item, "launcher");
195− launcher.state = "visible";
195+ launcher.state = "visible";
196+ }
196 }
197 }
198+ Button {
199+ text: "Print focused"
200+ activeFocusOnPress: false
201+ onClicked: {
202+ var childs = new Array(0);
203+ childs.push(shellLoader.item)
204+ while (childs.length > 0) {
205+ if (childs[0].activeFocus && childs[0].focus && childs[0].objectName != "shell") {
206+ print("Active focus is on item:", childs[0]);
207+ return;
208+ }
209+ for (var i in childs[0].children) {
210+ childs.push(childs[0].children[i])
211+ }
212+ childs.splice(0, 1);
213+ }
214+ print("No active focused item found within shell.")
215+ }
216+ }
217+ }
218+ Label {
219+ text: "LightDM mock mode"
197 }
220 }
221+
198 ListItem.ItemSelector {
222 ListItem.ItemSelector {
199 anchors { left: parent.left; right: parent.right }
223 anchors { left: parent.left; right: parent.right }
200 activeFocusOnPress: false
224 activeFocusOnPress: false
201− text: "LightDM mock mode"
202 model: ["single", "single-passphrase", "single-pin", "full"]
225 model: ["single", "single-passphrase", "single-pin", "full"]
203 onSelectedIndexChanged: {
226 onSelectedIndexChanged: {
204 shellLoader.active = false;
227 shellLoader.active = false;
@@ -207,11 +230,14 @@ Rectangle {
207 shellLoader.active = true;
230 shellLoader.active = true;
208 }
231 }
209 }
232 }
233+ Label {
234+ text: "Size"
235+ }
236+
210 ListItem.ItemSelector {
237 ListItem.ItemSelector {
211 id: sizeSelector
238 id: sizeSelector
212 anchors { left: parent.left; right: parent.right }
239 anchors { left: parent.left; right: parent.right }
213 activeFocusOnPress: false
240 activeFocusOnPress: false
214− text: "Size"
215 model: ["phone", "tablet", "desktop"]
241 model: ["phone", "tablet", "desktop"]
216 onSelectedIndexChanged: {
242 onSelectedIndexChanged: {
217// shellLoader.active = false;
243// shellLoader.active = false;
@@ -219,22 +245,28 @@ Rectangle {
219// shellLoader.active = true;
245// shellLoader.active = true;
220 }
246 }
221 }
247 }
248+ Label {
249+ text: "Usage scenario"
250+ }
251+
222 ListItem.ItemSelector {
252 ListItem.ItemSelector {
223 id: usageScenarioSelector
253 id: usageScenarioSelector
224 anchors { left: parent.left; right: parent.right }
254 anchors { left: parent.left; right: parent.right }
225 activeFocusOnPress: false
255 activeFocusOnPress: false
226− text: "Usage scenario"
227 model: ["phone", "tablet", "desktop"]
256 model: ["phone", "tablet", "desktop"]
228 }
257 }
229 MouseTouchEmulationCheckbox {
258 MouseTouchEmulationCheckbox {
230 id: mouseEmulation
259 id: mouseEmulation
231 checked: true
260 checked: true
232 }
261 }
262+ Label {
263+ text: "Ctrl key as"
264+ }
265+
233 ListItem.ItemSelector {
266 ListItem.ItemSelector {
234 id: ctrlModifier
267 id: ctrlModifier
235 anchors { left: parent.left; right: parent.right }
268 anchors { left: parent.left; right: parent.right }
236 activeFocusOnPress: false
269 activeFocusOnPress: false
237− text: "Ctrl key as"
238 model: ["Ctrl", "Alt", "Super"]
270 model: ["Ctrl", "Alt", "Super"]
239 onSelectedIndexChanged: {
271 onSelectedIndexChanged: {
240 var keyMapper = testCase.findChild(shellContainer, "physicalKeysMapper");
272 var keyMapper = testCase.findChild(shellContainer, "physicalKeysMapper");