on xenial help sign in
adjust sizings as per design spec, add a label for the current highlighted window
9636bc0Michael Zanetti
qml/Stages/DesktopStage.qml+20−9
@@ -138,7 +138,7 @@ Rectangle {
138 id: appRepeater
138 id: appRepeater
139 model: ApplicationManager
139 model: ApplicationManager
140
140
141− property int highlightedIndex: 1
141+ property int highlightedIndex: -1
142
142
143 delegate: Item {
143 delegate: Item {
144 id: appDelegate
144 id: appDelegate
@@ -365,17 +365,18 @@ Rectangle {
365 spacing: units.gu(1)
365 spacing: units.gu(1)
366 Item { Layout.fillWidth: true }
366 Item { Layout.fillWidth: true }
367 Repeater {
367 Repeater {
368− model: 2 // TODO: should be workspacemodel
368+ model: 1 // TODO: will be a workspacemodel in the future
369 Item {
369 Item {
370 Layout.fillHeight: true
370 Layout.fillHeight: true
371 Layout.preferredWidth: ((height - units.gu(6)) * root.width / root.height)
371 Layout.preferredWidth: ((height - units.gu(6)) * root.width / root.height)
372 Image {
372 Image {
373 source: root.background
373 source: root.background
374 anchors {
374 anchors {
375− fill: parent;
375+ left: parent.left
376− topMargin: units.gu(2);
376+ right: parent.right
377− bottomMargin: units.gu(2);
377+ verticalCenter: parent.verticalCenter
378 }
378 }
379+ height: parent.height * 0.75
379
380
380 ShaderEffect {
381 ShaderEffect {
381 anchors.fill: parent
382 anchors.fill: parent
@@ -412,10 +413,11 @@ Rectangle {
412 Layout.preferredWidth: ((height - units.gu(6)) * root.width / root.height)
413 Layout.preferredWidth: ((height - units.gu(6)) * root.width / root.height)
413 Rectangle {
414 Rectangle {
414 anchors {
415 anchors {
415− fill: parent;
416+ left: parent.left
416− topMargin: units.gu(2);
417+ right: parent.right
417− bottomMargin: units.gu(2);
418+ verticalCenter: parent.verticalCenter
418 }
419 }
420+ height: parent.height * 0.75
419 color: "#22ffffff"
421 color: "#22ffffff"
420
422
421 Label {
423 Label {
@@ -429,6 +431,13 @@ Rectangle {
429 }
431 }
430 }
432 }
431
433
434+ Label {
435+ id: currentSelectedLabel
436+ anchors { bottom: parent.bottom; bottomMargin: root.height * 0.625; horizontalCenter: parent.horizontalCenter }
437+ text: ApplicationManager.get(appRepeater.highlightedIndex).name
438+ visible: false
439+ }
440+
432 Label {
441 Label {
433 anchors { left: parent.left; bottom: parent.bottom; margins: units.gu(1) }
442 anchors { left: parent.left; bottom: parent.bottom; margins: units.gu(1) }
434 text: "Progress: " + (spreadFlickable.contentX / (spreadFlickable.contentWidth - spreadFlickable.width)).toFixed(3) +
443 text: "Progress: " + (spreadFlickable.contentX / (spreadFlickable.contentWidth - spreadFlickable.width)).toFixed(3) +
@@ -449,6 +458,7 @@ Rectangle {
449 name: "altTab"; when: root.altTabPressed
458 name: "altTab"; when: root.altTabPressed
450 PropertyChanges { target: workspaceSelector; visible: true }
459 PropertyChanges { target: workspaceSelector; visible: true }
451 PropertyChanges { target: spreadFlickable; enabled: true }
460 PropertyChanges { target: spreadFlickable; enabled: true }
461+ PropertyChanges { target: currentSelectedLabel; visible: true }
452 }
462 }
453 ]
463 ]
454 signal updateWorkspaces();
464 signal updateWorkspaces();
@@ -465,8 +475,8 @@ Rectangle {
465 PropertyAction { target: spreadFlickable; property: "visible" }
475 PropertyAction { target: spreadFlickable; property: "visible" }
466 PropertyAction { target: spreadFlickable; property: "contentX";
476 PropertyAction { target: spreadFlickable; property: "contentX";
467 value: ((spreadFlickable.contentWidth) / (ApplicationManager.count + 1)) * Math.max(0, Math.min(ApplicationManager.count - 3, 1));
477 value: ((spreadFlickable.contentWidth) / (ApplicationManager.count + 1)) * Math.max(0, Math.min(ApplicationManager.count - 3, 1));
468−
469 }
478 }
479+ PropertyAction { target: appRepeater; property: "highlightedIndex"; value: 1 }
470 }
480 }
471 },
481 },
472 Transition {
482 Transition {
@@ -474,6 +484,7 @@ Rectangle {
474 to: "*"
484 to: "*"
475 PropertyAnimation { property: "opacity" }
485 PropertyAnimation { property: "opacity" }
476 PropertyAction { target: root; property: "workspacesUpdated"; value: false }
486 PropertyAction { target: root; property: "workspacesUpdated"; value: false }
487+ PropertyAction { target: appRepeater; property: "highlightedIndex"; value: -1 }
477 }
488 }
478
489
479 ]
490 ]
qml/Stages/SpreadMaths.qml+1−8
@@ -17,7 +17,7 @@ Item {
17
17
18 // Spread properties
18 // Spread properties
19 property real spreadHeight: sceneHeight * 0.4
19 property real spreadHeight: sceneHeight * 0.4
20− property int spreadBottomOffset: sceneHeight * 0.2
20+ property int spreadBottomOffset: sceneHeight * 0.18
21 property int foldingAreaWidth: flickableWidth * 0.2
21 property int foldingAreaWidth: flickableWidth * 0.2
22 property int maxVisibleItems: 7
22 property int maxVisibleItems: 7
23 property int margins: flickableWidth * 0.05
23 property int margins: flickableWidth * 0.05
@@ -50,13 +50,6 @@ Item {
50
50
51 readonly property real middleSectionProgress: (linearX - margins - foldingAreaWidth) / (flickableWidth - (margins + foldingAreaWidth) * 2)
51 readonly property real middleSectionProgress: (linearX - margins - foldingAreaWidth) / (flickableWidth - (margins + foldingAreaWidth) * 2)
52
52
53− Label {
54− anchors { left: parent.left; top: parent.top; topMargin: - 100 }
55− text: middleSectionProgress.toFixed(2)
56− color: "green"
57− fontSize: "x-large"
58− }
59−
60 // Output
53 // Output
61 readonly property int animatedX: {
54 readonly property int animatedX: {
62 if (leftFoldingAreaProgress > 4) { // Stop it at the edge
55 if (leftFoldingAreaProgress > 4) { // Stop it at the edge