~f-riccardo87/ubuntu-calculator-app/new-design

« back to all changes in this revision

Viewing changes to KeyboardsView.qml

  • Committer: Tarmac
  • Author(s): Riccardo Ferrazzo
  • Date: 2013-02-25 17:02:52 UTC
  • mfrom: (11.1.2 ubuntu-calculator-app)
  • Revision ID: tarmac-20130225170252-18wene593v375ea5
Ui tweaks, solved bug #1132702, solved bug #1132692.

Approved by Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    contentHeight: stdKeyboard.height
10
10
 
11
11
    property double buttonRowHeight: units.gu(8);
 
12
    property double targetPosition
12
13
 
13
14
    onMovementEnded: {
14
 
       var stopPositionInRow = contentY % buttonRowHeight
 
15
       var stopPositionInRow = contentY % buttonRowHeight;
15
16
       if( Math.abs(stopPositionInRow) > (buttonRowHeight/2)) {
16
 
            contentY += (buttonRowHeight - stopPositionInRow)
 
17
            targetPosition = contentY+(buttonRowHeight - stopPositionInRow)
17
18
       }
18
19
       else {
19
 
            contentY -=  stopPositionInRow
 
20
            targetPosition = contentY -stopPositionInRow
20
21
       }
 
22
       snap.start();
21
23
    }
22
24
 
 
25
    NumberAnimation {id: snap; target: keyboardsView; property: "contentY"; to: targetPosition }
 
26
 
23
27
    StdKeyboard {
24
28
        id: stdKeyboard
25
29
        width: keyboardsView.width