on xenial help sign in
fix close button getting stuck
commit0c0f9d8c550c6d0ee6c8eafb0cb4f555df059c09 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 22 May 2015, 16:42 (11 years ago) parentf14ce28
2 files changed+16−28
qml/Stages/DesktopStage.qml+10−28 qml/Stages/SpreadMaths.qml+6
qml/Stages/DesktopStage.qml+10−28
@@ -283,23 +283,23 @@ Rectangle {
283283 }
284284
285285 Image {
286− anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 }
286+ id: closeImage
287+ anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
287288 source: "graphics/window-close.svg"
288289 visible: spreadSelectArea.upperThirdContainsMouse || closeMouseArea.containsMouse
289290 height: units.gu(1.5)
290291 width: height
291292 sourceSize.width: width
292293 sourceSize.height: height
293−
294− MouseArea {
295− id: closeMouseArea
296− anchors.fill: parent
297− anchors.margins: -units.gu(1)
298− hoverEnabled: true
299− onClicked: ApplicationManager.stopApplication(model.appId)
300− }
301294 }
302295
296+ MouseArea {
297+ id: closeMouseArea
298+ anchors.fill: closeImage
299+ anchors.margins: -units.gu(1)
300+ hoverEnabled: true
301+ onClicked: ApplicationManager.stopApplication(model.appId)
302+ }
303303
304304 ColumnLayout {
305305 id: tileInfo
@@ -334,16 +334,10 @@ Rectangle {
334334 contentWidth: Math.max(6, ApplicationManager.count) * Math.min(height / 4, width / 5)
335335 enabled: false
336336
337− //visible: false
338− //boundsBehavior: Flickable.StopAtBounds
339−
340337 onContentXChanged: print("contentXChanged", contentX)
341338
342− function ensureVisible(index) {
343−
344− }
345−
346339 function snapTo(contentX) {
340+ snapAnimation.stop();
347341 snapAnimation.to = contentX
348342 snapAnimation.start();
349343 }
@@ -446,18 +440,6 @@ Rectangle {
446440 visible: false
447441 }
448442
449− Label {
450− anchors { left: parent.left; bottom: parent.bottom; margins: units.gu(1) }
451− text: "Progress: " + (spreadFlickable.contentX / (spreadFlickable.contentWidth - spreadFlickable.width)).toFixed(3) +
452− ", ContentX: " + spreadFlickable.contentX +
453− ", Width: " + spreadFlickable.width +
454− ", ContentWidth: " + spreadFlickable.contentWidth
455−
456− color: "red"
457− fontSize: "x-large"
458− z: 100
459− }
460−
461443 states: [
462444 State {
463445 name: "windowed"
qml/Stages/SpreadMaths.qml+6
@@ -110,6 +110,12 @@ Item {
110110 linearAnimation(0, 1, 1, 1 + stackScale, rightEasing.value)
111111 : 0.95 + Math.abs(middleSectionProgress - 0.5) * 0.1
112112
113+ readonly property real closeIconOffset: limitedLeftProgress > 0 ?
114+ linearAnimation(0, 1, 0, - itemHeight * stackScale * 0.5, leftEasing.value)
115+ : limitedRightProgress > 0 ?
116+ linearAnimation(0, 1, 0, - itemHeight * stackScale * 0.5, rightEasing.value)
117+ : 0
118+
113119 readonly property real tileInfoOpacity: leftFoldingAreaProgress > 0 ?
114120 linearAnimation(1, 2, 1, 0, leftFoldingAreaProgress)
115121 : rightFoldingAreaProgress > 0 ?