@@ -347,12 +347,20 @@ FocusScope {
347 top: parent.top
347 top: parent.top
348 topMargin: root.inverted ? root.topPanelHeight : 0
348 topMargin: root.inverted ? root.topPanelHeight : 0
349 bottom: parent.bottom
349 bottom: parent.bottom
351 width: Math.min(root.width, units.gu(90)) * .9
352 width: Math.min(root.width, units.gu(90)) * .9
353 panelWidth: panel.width
353 panelWidth: panel.width
354 visible: x > -width
354 visible: x > -width
356+ Behavior on anchors.rightMargin {
357+ enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate && !drawer.draggingHorizontally
360+ easing.type: Easing.OutCubic
356 onApplicationSelected: {
364 onApplicationSelected: {
357 root.hide();
365 root.hide();
358 root.launcherApplicationSelected(appId)
366 root.launcherApplicationSelected(appId)
@@ -365,7 +373,7 @@ FocusScope {
367 onDragDistanceChanged: {
375 onDragDistanceChanged: {
368− x = Math.min(0, x-dragDistance);
376+ anchors.rightMargin = Math.max(-drawer.width, anchors.rightMargin + dragDistance);
370 onDraggingHorizontallyChanged: {
378 onDraggingHorizontallyChanged: {
371 if (!draggingHorizontally) {
379 if (!draggingHorizontally) {
@@ -496,12 +504,12 @@ FocusScope {
496 if (root.drawerEnabled && dragging && launcher.state != "drawer") {
504 if (root.drawerEnabled && dragging && launcher.state != "drawer") {
497 var drawerHintDistance = panel.width + units.gu(1)
505 var drawerHintDistance = panel.width + units.gu(1)
498 if (distance < drawerHintDistance) {
506 if (distance < drawerHintDistance) {
499− drawer.x = -drawer.width + Math.min(Math.max(0, distance), drawer.width);
507+ drawer.anchors.rightMargin = -Math.min(Math.max(0, distance), drawer.width);
501 var linearDrawerX = Math.min(Math.max(0, distance - drawerHintDistance), drawer.width);
509 var linearDrawerX = Math.min(Math.max(0, distance - drawerHintDistance), drawer.width);
502 var linearDrawerProgress = linearDrawerX / (drawer.width)
510 var linearDrawerProgress = linearDrawerX / (drawer.width)
503 var easedDrawerProgress = easeInOutCubic(linearDrawerProgress);
511 var easedDrawerProgress = easeInOutCubic(linearDrawerProgress);
504− drawer.x = (-drawer.width + drawerHintDistance) + easedDrawerProgress * (drawer.width - drawerHintDistance);
512+ drawer.anchors.rightMargin = -(drawerHintDistance + easedDrawerProgress * (drawer.width - drawerHintDistance));
@@ -532,7 +540,7 @@ FocusScope {
533 PropertyChanges {
541 PropertyChanges {
534 target: drawer
542 target: drawer
535− x: -drawer.width
543+ anchors.rightMargin: 0
@@ -541,17 +549,13 @@ FocusScope {
541 target: panel
549 target: panel
542 x: -root.x // so we never go past panelWidth, even when teased by tutorial
550 x: -root.x // so we never go past panelWidth, even when teased by tutorial
550 name: "drawer"
554 name: "drawer"
551 extend: "visible"
555 extend: "visible"
552 PropertyChanges {
556 PropertyChanges {
553 target: drawer
557 target: drawer
554− x: -root.x // so we never go past panelWidth, even when teased by tutorial
558+ anchors.rightMargin: -drawer.width + root.x // so we never go past panelWidth, even when teased by tutorial
@@ -579,12 +583,4 @@ FocusScope {
586− UbuntuNumberAnimation { target: panel; property: "x"; easing: Easing.OutQuad; duration: UbuntuAnimation.SnapDuration }
587− UbuntuNumberAnimation { target: drawer; property: "x"; easing: Easing.OutQuad; duration: UbuntuAnimation.SnapDuration }