@@ -29,62 +29,67 @@ import Ubuntu.Gestures 0.1
32− width: 700
32+ width: units.gu(70)
33− height: 500
33+ height: units.gu(70)
35 property var dragHandle
35 property var dragHandle
37 property bool stretch: false
37 property bool stretch: false
38 property real hintDisplacement: 0
38 property real hintDisplacement: 0
40− VerticalShowable {
40+ Item {
41− onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
41+ id: baseItem
42− stretch: root.stretch
42+ anchors.fill: parent
43− hintDisplacement: root.hintDisplacement
47− onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
48− stretch: root.stretch
49− hintDisplacement: root.hintDisplacement
52− // Visually mark drag threshold
44+ VerticalShowable {
53− Rectangle {
45+ onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
54− color: "black"
46+ stretch: root.stretch
55− width: 2
47+ hintDisplacement: root.hintDisplacement
56− height: parent.height
48+ }
58− visible: dragHandle !== undefined && Direction.isHorizontal(dragHandle.direction)
50+ HorizontalShowable {
51+ onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
52+ stretch: root.stretch
53+ hintDisplacement: root.hintDisplacement
56+ // Visually mark drag threshold
60+ height: parent.height
62+ visible: dragHandle !== undefined && Direction.isHorizontal(dragHandle.direction)
61− if (dragHandle) {
65+ if (dragHandle) {
62− if (dragHandle.direction === Direction.Rightwards) {
66+ if (dragHandle.direction === Direction.Rightwards) {
67+ dragHandle.edgeDragEvaluator.dragThreshold;
63− dragHandle.edgeDragEvaluator.dragThreshold;
69+ parent.width - dragHandle.edgeDragEvaluator.dragThreshold;
65− parent.width - dragHandle.edgeDragEvaluator.dragThreshold;
72+ 0
72− Rectangle {
76+ Rectangle {
73− color: "black";
77+ color: "black";
74− height: 2
78+ height: 2
75− width: parent.width
79+ width: parent.width
77− visible: dragHandle !== undefined && Direction.isVertical(dragHandle.direction)
81+ visible: dragHandle !== undefined && Direction.isVertical(dragHandle.direction)
80− if (dragHandle) {
84+ if (dragHandle) {
81− if (dragHandle.direction === Direction.Downwards) {
85+ if (dragHandle.direction === Direction.Downwards) {
86+ dragHandle.edgeDragEvaluator.dragThreshold;
82− dragHandle.edgeDragEvaluator.dragThreshold;
88+ parent.height - dragHandle.edgeDragEvaluator.dragThreshold;
84− parent.height - dragHandle.edgeDragEvaluator.dragThreshold;
91+ 0
@@ -119,27 +124,37 @@ Item {
122− TestButton {
127+ Row {
124 anchors.bottom: parent.bottom
128 anchors.bottom: parent.bottom
125 anchors.left: parent.left
129 anchors.left: parent.left
126 anchors.margins: units.gu(1)
130 anchors.margins: units.gu(1)
131+ spacing: units.gu(1)
128− text: root.stretch ? "stretch" : "move"
135+ text: root.stretch ? "stretch" : "move"
129− onClicked: { root.stretch = !root.stretch; }
136+ onClicked: { root.stretch = !root.stretch; }
132− TestButton {
139+ Button {
133− anchors.bottom: parent.bottom
140+ text: root.hintDisplacement > 0 ? "hint" : "no hint"
134− anchors.left: stretchButton.right
141+ onClicked: {
135− anchors.margins: units.gu(1)
142+ if (root.hintDisplacement > 0) {
143+ root.hintDisplacement = 0;
145+ root.hintDisplacement = units.gu(6);
137− text: root.hintDisplacement > 0 ? "hint" : "no hint"
150+ Button {
151+ text: "rotation: " + baseItem.rotation
138− onClicked: {
152+ onClicked: {
139− if (root.hintDisplacement > 0) {
153+ if (baseItem.rotation === 0.0) {
140− root.hintDisplacement = 0;
154+ baseItem.rotation = 90.0
141− } else {
155+ } else {
142− root.hintDisplacement = units.gu(6);
156+ baseItem.rotation = 0.0