@@ -347,12 +347,20 @@ FocusScope {
347347 top: parent.top
348348 topMargin: root.inverted ? root.topPanelHeight : 0
349349 bottom: parent.bottom
350+ right: parent.left
350351 }
351352 width: Math.min(root.width, units.gu(90)) * .9
352− x: -width
353353 panelWidth: panel.width
354354 visible: x > -width
355355
356+ Behavior on anchors.rightMargin {
357+ enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate && !drawer.draggingHorizontally
358+ NumberAnimation {
359+ duration: 300
360+ easing.type: Easing.OutCubic
361+ }
362+ }
363+
356364 onApplicationSelected: {
357365 root.hide();
358366 root.launcherApplicationSelected(appId)
@@ -365,7 +373,7 @@ FocusScope {
365373 }
366374
367375 onDragDistanceChanged: {
368− x = Math.min(0, x-dragDistance);
376+ anchors.rightMargin = Math.max(-drawer.width, anchors.rightMargin + dragDistance);
369377 }
370378 onDraggingHorizontallyChanged: {
371379 if (!draggingHorizontally) {
@@ -496,12 +504,12 @@ FocusScope {
496504 if (root.drawerEnabled && dragging && launcher.state != "drawer") {
497505 var drawerHintDistance = panel.width + units.gu(1)
498506 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);
500508 } else {
501509 var linearDrawerX = Math.min(Math.max(0, distance - drawerHintDistance), drawer.width);
502510 var linearDrawerProgress = linearDrawerX / (drawer.width)
503511 var easedDrawerProgress = easeInOutCubic(linearDrawerProgress);
504− drawer.x = (-drawer.width + drawerHintDistance) + easedDrawerProgress * (drawer.width - drawerHintDistance);
512+ drawer.anchors.rightMargin = -(drawerHintDistance + easedDrawerProgress * (drawer.width - drawerHintDistance));
505513 }
506514 }
507515 }
@@ -532,7 +540,7 @@ FocusScope {
532540 }
533541 PropertyChanges {
534542 target: drawer
535− x: -drawer.width
543+ anchors.rightMargin: 0
536544 }
537545 },
538546 State {
@@ -541,17 +549,13 @@ FocusScope {
541549 target: panel
542550 x: -root.x // so we never go past panelWidth, even when teased by tutorial
543551 }
544− PropertyChanges {
545− target: drawer
546− x: -drawer.width
547− }
548552 },
549553 State {
550554 name: "drawer"
551555 extend: "visible"
552556 PropertyChanges {
553557 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
555559 }
556560 },
557561 State {
@@ -579,12 +583,4 @@ FocusScope {
579583 }
580584 }
581585 ]
582− transitions: [
583− Transition {
584− from: "*"
585− to: "*"
586− UbuntuNumberAnimation { target: panel; property: "x"; easing: Easing.OutQuad; duration: UbuntuAnimation.SnapDuration }
587− UbuntuNumberAnimation { target: drawer; property: "x"; easing: Easing.OutQuad; duration: UbuntuAnimation.SnapDuration }
588− }
589− ]
590586}