Merge lp:~dalius-sandbox/ubuntu-calculator-app/tear-off-formula into lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk

Proposed by Dalius
Status: Merged
Approved by: Riccardo Ferrazzo
Approved revision: 36
Merged at revision: 37
Proposed branch: lp:~dalius-sandbox/ubuntu-calculator-app/tear-off-formula
Merge into: lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk
Diff against target: 51 lines (+22/-1)
2 files modified
Simple/CalcKeyboard.qml (+1/-1)
Simple/SimplePage.qml (+21/-0)
To merge this branch: bzr merge lp:~dalius-sandbox/ubuntu-calculator-app/tear-off-formula
Reviewer Review Type Date Requested Status
Riccardo Ferrazzo (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+154774@code.launchpad.net

Commit message

Tear off implementation

Description of the change

Tear off implementation

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Riccardo Ferrazzo (f-riccardo87) wrote :

Nice and clean solution!
We need to play a little with transitions and animations to get a better behaviour.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Simple/CalcKeyboard.qml'
2--- Simple/CalcKeyboard.qml 2013-03-14 15:44:07 +0000
3+++ Simple/CalcKeyboard.qml 2013-03-21 17:58:22 +0000
4@@ -12,7 +12,7 @@
5
6 anchors{
7 top: parent.top
8- topMargin: units.gu(2)
9+ topMargin: units.gu(2) + (formulaView.__wasAtYBegining & formulaView.__displaceDist > 0 ? formulaView.__displaceDist : 0)
10 horizontalCenter: parent.horizontalCenter
11 }
12
13
14=== modified file 'Simple/SimplePage.qml'
15--- Simple/SimplePage.qml 2013-03-20 16:28:57 +0000
16+++ Simple/SimplePage.qml 2013-03-21 17:58:22 +0000
17@@ -149,6 +149,11 @@
18 verticalLayoutDirection: ListView.BottomToTop
19 clip: true
20
21+ property bool __wasAtYBegining: false
22+ property int __initialContentY: 0
23+ property bool __toBeRefresh: false
24+ property int __displaceDist: contentY - __initialContentY
25+
26 signal currentOperatorsChanged()
27
28 function addCurrentToMemory() {
29@@ -263,6 +268,22 @@
30 }
31 storage.saveCalculations(calculations)
32 }
33+
34+ onMovementStarted: {
35+ __wasAtYBegining = atYEnd
36+ __initialContentY = contentY
37+ }
38+ onContentYChanged: {
39+ if (__wasAtYBegining && __displaceDist > units.gu(5))
40+ __toBeRefresh = true
41+ }
42+ onMovementEnded: {
43+ if (__toBeRefresh) {
44+ formulaView.addCurrentToMemory();
45+ clear();
46+ __toBeRefresh = false
47+ }
48+ }
49 }
50 }
51 }

Subscribers

People subscribed via source and target branches