Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/textFromOuterSpaceTrunk into lp:ubuntu-ui-toolkit

Proposed by Cris Dywan
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 1248
Merged at revision: 1249
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/textFromOuterSpaceTrunk
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 166 lines (+26/-17)
5 files modified
src/Ubuntu/Components/1.2/TextCursor.qml (+6/-5)
src/Ubuntu/Components/1.3/TextCursor.qml (+6/-5)
src/Ubuntu/Components/Themes/Ambiance/1.2/TextCursorStyle.qml (+6/-3)
src/Ubuntu/Components/Themes/Ambiance/1.3/TextCursorStyle.qml (+6/-3)
tests/unit_x11/tst_components/tst_textinput_touch.qml (+2/-1)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/textFromOuterSpaceTrunk
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu SDK team Pending
Review via email: mp+276265@code.launchpad.net

Commit message

Smaller handlers, entirely draggable caret

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Ubuntu/Components/1.2/TextCursor.qml'
--- src/Ubuntu/Components/1.2/TextCursor.qml 2015-06-10 17:23:51 +0000
+++ src/Ubuntu/Components/1.2/TextCursor.qml 2015-10-30 13:44:09 +0000
@@ -157,9 +157,9 @@
157 //dragged item157 //dragged item
158 property Item draggedItem: Item {158 property Item draggedItem: Item {
159 objectName: cursorItem.positionProperty + "_draggeditem"159 objectName: cursorItem.positionProperty + "_draggeditem"
160 width: caret.width + units.gu(4)160 width: caret.width + units.gu(2)
161 onWidthChanged: draggedItem.moveToCaret()161 onWidthChanged: draggedItem.moveToCaret()
162 height: caret.height + units.gu(4)162 height: cursorItem.height + caret.height + units.gu(2)
163 parent: fakeCursor.parent163 parent: fakeCursor.parent
164 visible: caret.visible164 visible: caret.visible
165165
@@ -204,8 +204,10 @@
204 if (!caret) {204 if (!caret) {
205 return;205 return;
206 }206 }
207 draggedItem.x = fakeCursor.x - draggedItem.width / 2;207 // The style may render handlers either on top or bottom
208 draggedItem.y = fakeCursor.y + caret.y - caret.height / 2;208 var flip = caret.rotation == 180;
209 draggedItem.x = fakeCursor.x + (flip ? -units.gu(1) : -draggedItem.width + units.gu(1));
210 draggedItem.y = fakeCursor.y - caret.height - units.gu(0.5);
209 }211 }
210 // positions caret to the dragged position212 // positions caret to the dragged position
211 function positionCaret() {213 function positionCaret() {
@@ -214,7 +216,6 @@
214 var dy = dragger.dragStartY + dragger.dragAmountY + handler.flickable.contentY;216 var dy = dragger.dragStartY + dragger.dragAmountY + handler.flickable.contentY;
215 dx -= handler.frameDistance.x;217 dx -= handler.frameDistance.x;
216 dy -= handler.frameDistance.y;218 dy -= handler.frameDistance.y;
217 dy -= draggedItem.height / 2;
218 handler.positionCaret(positionProperty, dx, dy);219 handler.positionCaret(positionProperty, dx, dy);
219 }220 }
220 }221 }
221222
=== modified file 'src/Ubuntu/Components/1.3/TextCursor.qml'
--- src/Ubuntu/Components/1.3/TextCursor.qml 2015-08-11 17:15:59 +0000
+++ src/Ubuntu/Components/1.3/TextCursor.qml 2015-10-30 13:44:09 +0000
@@ -158,9 +158,9 @@
158 //dragged item158 //dragged item
159 property Item draggedItem: Item {159 property Item draggedItem: Item {
160 objectName: cursorItem.positionProperty + "_draggeditem"160 objectName: cursorItem.positionProperty + "_draggeditem"
161 width: caret.width + units.gu(4)161 width: caret.width + units.gu(2)
162 onWidthChanged: draggedItem.moveToCaret()162 onWidthChanged: draggedItem.moveToCaret()
163 height: caret.height + units.gu(4)163 height: cursorItem.height + caret.height + units.gu(2)
164 parent: fakeCursor.parent164 parent: fakeCursor.parent
165 visible: caret.visible165 visible: caret.visible
166166
@@ -206,8 +206,10 @@
206 if (!caret) {206 if (!caret) {
207 return;207 return;
208 }208 }
209 draggedItem.x = fakeCursor.x - draggedItem.width / 2;209 // The style may render handlers either on top or bottom
210 draggedItem.y = fakeCursor.y + caret.y - caret.height / 2;210 var flip = caret.rotation == 180;
211 draggedItem.x = fakeCursor.x + (flip ? -units.gu(1) : -draggedItem.width + units.gu(1));
212 draggedItem.y = fakeCursor.y - caret.height - units.gu(0.5);
211 }213 }
212 // positions caret to the dragged position214 // positions caret to the dragged position
213 function positionCaret() {215 function positionCaret() {
@@ -216,7 +218,6 @@
216 var dy = dragger.dragStartY + dragger.dragAmountY + handler.flickable.contentY;218 var dy = dragger.dragStartY + dragger.dragAmountY + handler.flickable.contentY;
217 dx -= handler.frameDistance.x;219 dx -= handler.frameDistance.x;
218 dy -= handler.frameDistance.y;220 dy -= handler.frameDistance.y;
219 dy -= draggedItem.height / 2;
220 handler.positionCaret(positionProperty, dx, dy);221 handler.positionCaret(positionProperty, dx, dy);
221 }222 }
222 }223 }
223224
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/TextCursorStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.2/TextCursorStyle.qml 2015-04-24 14:52:19 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.2/TextCursorStyle.qml 2015-10-30 13:44:09 +0000
@@ -57,7 +57,7 @@
57 width: cursorWidth57 width: cursorWidth
58 // FIXME: Extend the palette and use palette values here58 // FIXME: Extend the palette and use palette values here
59 color: UbuntuColors.blue59 color: UbuntuColors.blue
60 visible: styledItem.positionProperty === "cursorPosition" && (blinkTimer.timerShowCursor || !blinkTimer.running)60 visible: blinkTimer.timerShowCursor || !blinkTimer.running
61 Timer {61 Timer {
62 id: blinkTimer62 id: blinkTimer
63 interval: cursorStyle.cursorVisibleTimeout63 interval: cursorStyle.cursorVisibleTimeout
@@ -66,7 +66,7 @@
66 styledItem.visible &&66 styledItem.visible &&
67 shouldBlink67 shouldBlink
68 repeat: true68 repeat: true
69 property bool shouldBlink: !styledItem.readOnly && !styledItem.contextMenuVisible69 property bool shouldBlink: styledItem.positionProperty === "cursorPosition" && !styledItem.readOnly && !styledItem.contextMenuVisible
70 property bool timerShowCursor: true70 property bool timerShowCursor: true
71 onTriggered: {71 onTriggered: {
72 interval = (interval == cursorStyle.cursorVisibleTimeout) ?72 interval = (interval == cursorStyle.cursorVisibleTimeout) ?
@@ -82,8 +82,11 @@
82 id: caretItem82 id: caretItem
83 source: Qt.resolvedUrl("../artwork/caret_noshadow.png")83 source: Qt.resolvedUrl("../artwork/caret_noshadow.png")
84 objectName: "text_cursor_style_caret_" + styledItem.positionProperty84 objectName: "text_cursor_style_caret_" + styledItem.positionProperty
85 property bool flip: styledItem.positionProperty !== "selectionStart"
86 rotation: flip ? 180 : 0
85 anchors {87 anchors {
86 top: parent.bottom88 top: flip ? parent.bottom : undefined
89 bottom: flip ? undefined : parent.top
87 horizontalCenter: parent.horizontalCenter90 horizontalCenter: parent.horizontalCenter
88 horizontalCenterOffset: cursorWidth / 291 horizontalCenterOffset: cursorWidth / 2
89 }92 }
9093
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/TextCursorStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/TextCursorStyle.qml 2015-04-25 07:36:13 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/TextCursorStyle.qml 2015-10-30 13:44:09 +0000
@@ -57,7 +57,7 @@
57 width: cursorWidth57 width: cursorWidth
58 // FIXME: Extend the palette and use palette values here58 // FIXME: Extend the palette and use palette values here
59 color: UbuntuColors.blue59 color: UbuntuColors.blue
60 visible: styledItem.positionProperty === "cursorPosition" && (blinkTimer.timerShowCursor || !blinkTimer.running)60 visible: blinkTimer.timerShowCursor || !blinkTimer.running
61 Timer {61 Timer {
62 id: blinkTimer62 id: blinkTimer
63 interval: cursorStyle.cursorVisibleTimeout63 interval: cursorStyle.cursorVisibleTimeout
@@ -66,7 +66,7 @@
66 styledItem.visible &&66 styledItem.visible &&
67 shouldBlink67 shouldBlink
68 repeat: true68 repeat: true
69 property bool shouldBlink: !styledItem.readOnly && !styledItem.contextMenuVisible69 property bool shouldBlink: styledItem.positionProperty === "cursorPosition" && !styledItem.readOnly && !styledItem.contextMenuVisible
70 property bool timerShowCursor: true70 property bool timerShowCursor: true
71 onTriggered: {71 onTriggered: {
72 interval = (interval == cursorStyle.cursorVisibleTimeout) ?72 interval = (interval == cursorStyle.cursorVisibleTimeout) ?
@@ -82,8 +82,11 @@
82 id: caretItem82 id: caretItem
83 source: Qt.resolvedUrl("../artwork/caret_noshadow.png")83 source: Qt.resolvedUrl("../artwork/caret_noshadow.png")
84 objectName: "text_cursor_style_caret_" + styledItem.positionProperty84 objectName: "text_cursor_style_caret_" + styledItem.positionProperty
85 property bool flip: styledItem.positionProperty !== "selectionStart"
86 rotation: flip ? 180 : 0
85 anchors {87 anchors {
86 top: parent.bottom88 top: flip ? parent.bottom : undefined
89 bottom: flip ? undefined : parent.top
87 horizontalCenter: parent.horizontalCenter90 horizontalCenter: parent.horizontalCenter
88 horizontalCenterOffset: cursorWidth / 291 horizontalCenterOffset: cursorWidth / 2
89 }92 }
9093
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png'
91Binary files src/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 2015-06-03 20:07:08 +0000 and src/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 2015-10-30 13:44:09 +0000 differ94Binary files src/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 2015-06-03 20:07:08 +0000 and src/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 2015-10-30 13:44:09 +0000 differ
=== modified file 'tests/unit_x11/tst_components/tst_textinput_touch.qml'
--- tests/unit_x11/tst_components/tst_textinput_touch.qml 2015-03-10 11:49:27 +0000
+++ tests/unit_x11/tst_components/tst_textinput_touch.qml 2015-10-30 13:44:09 +0000
@@ -192,7 +192,7 @@
192 if(TestExtras.openGLflavor() == "opengles2" &&192 if(TestExtras.openGLflavor() == "opengles2" &&
193 TestExtras.cpuArchitecture() != "arm")193 TestExtras.cpuArchitecture() != "arm")
194 skip("This test doesn't pass with OpenGLES other than arm");194 skip("This test doesn't pass with OpenGLES other than arm");
195 data.input.focus = true;195 TestExtras.touchClick(0, data.input, centerOf(data.input));
196 popupSpy.target = findChild(data.input, "input_handler");196 popupSpy.target = findChild(data.input, "input_handler");
197197
198 TestExtras.touchLongPress(0, data.input, guPoint(1, 1));198 TestExtras.touchLongPress(0, data.input, guPoint(1, 1));
@@ -283,6 +283,7 @@
283 data.input.focus = true;283 data.input.focus = true;
284 data.input.cursorPosition = data.initialCursorPosition;284 data.input.cursorPosition = data.initialCursorPosition;
285 data.input.selectWord();285 data.input.selectWord();
286 verify(data.input.selectedText !== "", "No word selected initially!");
286 var selectedText = data.input.selectedText;287 var selectedText = data.input.selectedText;
287288
288 var caret = findChild(data.input, "input_handler")[data.cursorName + "Cursor"];289 var caret = findChild(data.input, "input_handler")[data.cursorName + "Cursor"];

Subscribers

People subscribed via source and target branches

to status/vote changes: