=== modified file 'qml/Launcher/Launcher.qml'
568 --- qml/Launcher/Launcher.qml 2014-12-11 13:24:26 +0000
569 +++ qml/Launcher/Launcher.qml 2015-01-08 14:55:47 +0000
570 @@ -26,6 +26,7 @@
571 property bool autohideEnabled: false
572 property bool available: true // can be used to disable all interactions
573 property alias inverted: panel.inverted
574 + property bool shadeBackground: true // can be used to disable background shade when launcher is visible
575
576 property int panelWidth: units.gu(8)
577 property int dragAreaWidth: units.gu(1)
578 @@ -33,6 +34,10 @@
579 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?
580 (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 0
581
582 + readonly property bool dragging: dragArea.dragging
583 + readonly property real dragDistance: dragArea.dragging ? dragArea.touchX : 0
584 + readonly property real visibleWidth: panel.width + panel.x
585 +
586 readonly property bool shown: panel.x > -panel.width
587
588 // emitted when an application is selected
589 @@ -154,7 +159,7 @@
590
591 MouseArea {
592 id: launcherDragArea
593 - enabled: root.state == "visible"
594 + enabled: root.available && root.state == "visible"
595 anchors.fill: panel
596 anchors.rightMargin: -units.gu(2)
597 drag {
598 @@ -180,7 +185,7 @@
599 right: parent.right
600 bottom: parent.bottom
601 }
602 - enabled: root.state == "visible"
603 + enabled: root.shadeBackground && root.state == "visible"
604 onPressed: {
605 root.state = ""
606 }
607 @@ -190,7 +195,7 @@
608 id: backgroundShade
609 anchors.fill: parent
610 color: "black"
611 - opacity: root.state == "visible" ? 0.6 : 0
612 + opacity: root.shadeBackground && root.state == "visible" ? 0.6 : 0
613
614 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } }
615 }
616 @@ -205,7 +210,7 @@
617 bottom: parent.bottom
618 }
619 x: -width
620 - visible: x > -width || dragArea.status === DirectionalDragArea.Undecided
621 + visible: root.x > 0 || x > -width || dragArea.status === DirectionalDragArea.Undecided
622 model: LauncherModel
623
624 property bool animate: true
625 @@ -247,6 +252,7 @@
626 direction: Direction.Rightwards
627
628 enabled: root.available
629 + x: -root.x // so if launcher is adjusted relative to screen, we stay put (like tutorial does when teasing)
630 width: root.dragAreaWidth
631 height: root.height
632
633 @@ -260,7 +266,7 @@
634 // would appear right next to the user's finger out of nowhere.
635 // Instead, we make the panel go towards the user's finger in several
636 // steps. ie., in an animated way.
637 - var targetPanelX = Math.min(0, touchX - panel.width)
638 + var targetPanelX = Math.min(0, touchX - panel.width) - root.x
639 var delta = targetPanelX - panel.x
640 // the trick is not to go all the way (1.0) as it would cause a sudden jump
641 panel.x += 0.4 * delta
642 @@ -292,7 +298,7 @@
643 name: "visible"
644 PropertyChanges {
645 target: panel
646 - x: 0
647 + x: -root.x // so we never go past panelWidth, even when teased by tutorial
648 }
649 },
650 State {
651