Merge lp:~gang65/ubuntu-calculator-app/expand_short_formula_after_change_cursor_position into lp:ubuntu-calculator-app

Proposed by Bartosz Kosiorek
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 27
Merged at revision: 26
Proposed branch: lp:~gang65/ubuntu-calculator-app/expand_short_formula_after_change_cursor_position
Merge into: lp:ubuntu-calculator-app
Diff against target: 17 lines (+7/-0)
1 file modified
app/ubuntu-calculator-app.qml (+7/-0)
To merge this branch: bzr merge lp:~gang65/ubuntu-calculator-app/expand_short_formula_after_change_cursor_position
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Review via email: mp+244062@code.launchpad.net

Commit message

Expand short formula to long formula, after change cursor position.
It will allow us to edit specific part of formula.

Description of the change

Expand short formula to long formula, after change cursor position.
It will allow us to edit specific part of formula.

To post a comment you must log in.
27. By Bartosz Kosiorek

Fix indentation

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Cool, works very well, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ubuntu-calculator-app.qml'
2--- app/ubuntu-calculator-app.qml 2014-12-08 18:53:33 +0000
3+++ app/ubuntu-calculator-app.qml 2014-12-08 22:38:26 +0000
4@@ -275,6 +275,13 @@
5 readOnly: true
6 selectByMouse: true
7 cursorVisible: true
8+ onCursorPositionChanged: if (cursorPosition !== displayedInputText.length ) {
9+ var preservedCursorPosition = cursorPosition;
10+ displayedInputText = returnFormulaToDisplay(longFormula);
11+ cursorPosition = preservedCursorPosition;
12+ } else {
13+ displayedInputText = returnFormulaToDisplay(shortFormula);
14+ }
15 }
16
17 ListView {

Subscribers

People subscribed via source and target branches