-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 38 | ||||
-rw-r--r-- | core/applets/rotateapplet/rotate.h | 2 |
2 files changed, 29 insertions, 11 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp index e236cd1..4743388 100644 --- a/core/applets/rotateapplet/rotate.cpp +++ b/core/applets/rotateapplet/rotate.cpp | |||
@@ -33,2 +33,3 @@ | |||
33 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
34 | #include <qpe/config.h> | ||
34 | #include <qiconset.h> | 35 | #include <qiconset.h> |
@@ -42,3 +43,3 @@ RotateApplet::RotateApplet ( ) | |||
42 | { | 43 | { |
43 | m_native = true; | 44 | m_flipped = false; |
44 | } | 45 | } |
@@ -94,13 +95,31 @@ void RotateApplet::activated ( ) | |||
94 | int newRotation; | 95 | int newRotation; |
95 | if ( m_native == true ) { | ||
96 | 96 | ||
97 | newRotation = currentRotation + 90; | 97 | Config cfg( "qpe" ); |
98 | if(newRotation >= 360) newRotation = 0;//ipaqs like the 36xx have the display | 98 | cfg.setGroup( "Appearance" ); |
99 | //rotated to 270 as default, so 360 does nothing => handle this here | ||
100 | 99 | ||
101 | } else { | 100 | // 0 -> 90° clockwise, 1 -> 90° counterclockwise |
102 | newRotation = currentRotation - 90; | 101 | bool rotDirection = cfg.readBoolEntry( "rotatedir" ); |
103 | if (newRotation <=0) newRotation = 270; | 102 | |
103 | // hide inputs methods before rotation | ||
104 | QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); | ||
105 | |||
106 | if ( m_flipped ) { | ||
107 | if ( rotDirection ) { | ||
108 | newRotation = currentRotation - 90; | ||
109 | if (newRotation <=0) newRotation = 270; | ||
104 | //ipaqs like the 36xx have the display rotated | 110 | //ipaqs like the 36xx have the display rotated |
105 | // to 270 as default, and -90 is invalid => handle this here | 111 | // to 270 as default, and -90 is invalid => handle this here |
112 | } else { | ||
113 | newRotation = currentRotation + 90; | ||
114 | if(newRotation >= 360) newRotation = 0;//ipaqs like the 36xx have the display | ||
115 | //rotated to 270 as default, so 360 does nothing => handle this here | ||
116 | } | ||
117 | } else { | ||
118 | if ( rotDirection ) { | ||
119 | newRotation = currentRotation + 90; | ||
120 | if(newRotation >= 360) newRotation = 0; | ||
121 | } else { | ||
122 | newRotation = currentRotation - 90; | ||
123 | if (newRotation <=0) newRotation = 270; | ||
124 | } | ||
106 | } | 125 | } |
@@ -111,4 +130,3 @@ void RotateApplet::activated ( ) | |||
111 | 130 | ||
112 | m_native = !m_native; | 131 | m_flipped = !m_flipped; |
113 | |||
114 | } | 132 | } |
diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h index c4087f9..57f9040 100644 --- a/core/applets/rotateapplet/rotate.h +++ b/core/applets/rotateapplet/rotate.h | |||
@@ -56,3 +56,3 @@ public: | |||
56 | private: | 56 | private: |
57 | bool m_native; | 57 | bool m_flipped; |
58 | ulong ref; | 58 | ulong ref; |