~ubuntu-sdk-team/ubuntu-ui-toolkit/orientationManual

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/OrientationHelper.qml

  • Committer: Christian Dywan
  • Date: 2015-04-02 16:00:37 UTC
  • Revision ID: christian@twotoasts.de-20150402160037-hywcni94p9pq3m1w
Revise AP tests for consistency and comments for clarity

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
 
84
84
      Calculates the current orientation angle.
85
85
     */
86
 
    readonly property int orientationAngle: automaticOrientation
 
86
    property int orientationAngle: automaticOrientation
87
87
        ? Screen.angleBetween(Screen.primaryOrientation, UbuntuApplication.orientation)
88
88
        : 0
89
89
    // Screen.primaryOrientation and Screen.orientation can change one right after the other,
90
90
    // causing orientationAngle to momentarily change. To avoid responding to such
91
91
    // intermediate states, wait for its value to stabilize before rotating to it.
92
 
    onOrientationAngleChanged: automaticOrientation ? stableOrientationAngleTimer.restart()
93
 
                                                    : d.tryUpdateState();
 
92
    onOrientationAngleChanged: { automaticOrientation ? stableOrientationAngleTimer.restart()
 
93
                                                    : d.tryUpdateState(); }
94
94
 
95
95
    /*!
96
96
      The property holds if the OrientationHelper should automatically resize the