summaryrefslogtreecommitdiff
path: root/core
authorkergoth <kergoth>2003-04-18 22:17:38 (UTC)
committer kergoth <kergoth>2003-04-18 22:17:38 (UTC)
commit6e7112a3610c4e562f991ba6d6f33ca2fe0c605d (patch) (unidiff)
treeae90d7b8c36c49f109e3c2f231a119fc7fd5b799 /core
parentd0852e67c15c5a973b7bc7f7bee238a6fd00dee6 (diff)
downloadopie-6e7112a3610c4e562f991ba6d6f33ca2fe0c605d.zip
opie-6e7112a3610c4e562f991ba6d6f33ca2fe0c605d.tar.gz
opie-6e7112a3610c4e562f991ba6d6f33ca2fe0c605d.tar.bz2
Make appearance and rotate applet use the new rotation method of odevice.
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/rotateapplet/rotate.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index 04270f1..62567ed 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -37,4 +37,8 @@
37 37
38#include <opie/odevice.h>
39
38#include "rotate.h" 40#include "rotate.h"
39 41
42using namespace Opie;
43
40 44
@@ -115,4 +119,3 @@ void RotateApplet::activated ( )
115 int defaultRotation = QPEApplication::defaultRotation(); 119 int defaultRotation = QPEApplication::defaultRotation();
116 120 int newRotation = defaultRotation;
117 int newRotation;
118 121
@@ -121,4 +124,10 @@ void RotateApplet::activated ( )
121 124
122 // 0 -> 90° clockwise, 1 -> 90° counterclockwise 125 int rotDirection = cfg.readNumEntry( "rotatedir" );
123 int rotDirection = cfg.readNumEntry( "rotatedir", 0 ); 126 ODirection rot = CW;
127
128 if (rotDirection == -1) {
129 rot = ODevice::inst ( )-> direction ( );
130 } else {
131 rot = (ODirection)rotDirection;
132 }
124 133
@@ -132,7 +141,7 @@ void RotateApplet::activated ( )
132 } else { 141 } else {
133 if ( rotDirection == 1 ) { 142 if ( rot == CCW ) {
134 newRotation = ( defaultRotation + 90 ) % 360; 143 newRotation = ( defaultRotation + 90 ) % 360;
135 } else if ( rotDirection == 0 ) { 144 } else if ( rot == CW ) {
136 newRotation = ( defaultRotation + 270 ) % 360; 145 newRotation = ( defaultRotation + 270 ) % 360;
137 } else { 146 } else if ( rot == Flip ) {
138 newRotation = ( defaultRotation + 180 ) % 360; 147 newRotation = ( defaultRotation + 180 ) % 360;
@@ -165,3 +174 @@ Q_EXPORT_INTERFACE( )
165} }
166
167