on xenial help sign in
TabletStage: Use Binding instead of JS settings a binding
8393c49Gerry Boland
qml/Stages/TabletStage.qml+7−8
@@ -536,6 +536,13 @@ Rectangle {
536 return progress;
536 return progress;
537 }
537 }
538
538
539+ Binding {
540+ target: appDelegate
541+ property: "orientation"
542+ when: appDelegate.interactive
543+ value: root.orientation
544+ }
545+
539 onClicked: {
546 onClicked: {
540 if (spreadView.phase == 2) {
547 if (spreadView.phase == 2) {
541 spreadView.snapTo(index);
548 spreadView.snapTo(index);
@@ -555,14 +562,6 @@ Rectangle {
555 ApplicationManager.stopApplication(ApplicationManager.get(index).appId);
562 ApplicationManager.stopApplication(ApplicationManager.get(index).appId);
556 }
563 }
557
564
558− onInteractiveChanged: {
559− if (interactive) {
560− appDelegate.orientation = Qt.binding( function() { return root.orientation; } );
561− } else {
562− appDelegate.orientation = root.orientation; // breaks the binding intentionally
563− }
564− }
565−
566 EasingCurve {
565 EasingCurve {
567 id: snappingCurve
566 id: snappingCurve
568 type: EasingCurve.Linear
567 type: EasingCurve.Linear