Diffstat (limited to 'core/applets/rotateapplet/rotate.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp index 0ead016..b490626 100644 --- a/core/applets/rotateapplet/rotate.cpp +++ b/core/applets/rotateapplet/rotate.cpp | |||
@@ -88,38 +88,40 @@ QPopupMenu *RotateApplet::popup ( QWidget * ) const | |||
88 | } | 88 | } |
89 | 89 | ||
90 | void RotateApplet::activated ( ) | 90 | void RotateApplet::activated ( ) |
91 | { | 91 | { |
92 | int defaultRotation = QPEApplication::defaultRotation(); | 92 | int defaultRotation = QPEApplication::defaultRotation(); |
93 | 93 | ||
94 | int newRotation; | 94 | int newRotation; |
95 | 95 | ||
96 | Config cfg( "qpe" ); | 96 | Config cfg( "qpe" ); |
97 | cfg.setGroup( "Appearance" ); | 97 | cfg.setGroup( "Appearance" ); |
98 | 98 | ||
99 | // 0 -> 90° clockwise, 1 -> 90° counterclockwise | 99 | // 0 -> 90° clockwise, 1 -> 90° counterclockwise |
100 | bool rotDirection = cfg.readBoolEntry( "rotatedir", 0 ); | 100 | int rotDirection = cfg.readNumEntry( "rotatedir", 0 ); |
101 | 101 | ||
102 | // hide inputs methods before rotation | 102 | // hide inputs methods before rotation |
103 | QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); | 103 | QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); |
104 | 104 | ||
105 | if ( m_flipped ) { | 105 | if ( m_flipped ) { |
106 | // if flipped, flip back to the original state, | 106 | // if flipped, flip back to the original state, |
107 | // regardless of rotation direction | 107 | // regardless of rotation direction |
108 | newRotation = defaultRotation; | 108 | newRotation = defaultRotation; |
109 | } else { | 109 | } else { |
110 | if ( rotDirection ) { | 110 | if ( rotDirection == 1 ) { |
111 | newRotation = ( defaultRotation + 90 ) % 360; | 111 | newRotation = ( defaultRotation + 90 ) % 360; |
112 | } else { | 112 | } else if ( rotDirection == 0 ) { |
113 | newRotation = ( defaultRotation + 270 ) % 360; | 113 | newRotation = ( defaultRotation + 270 ) % 360; |
114 | } else { | ||
115 | newRotation = ( defaultRotation + 180 ) % 360; | ||
114 | } | 116 | } |
115 | } | 117 | } |
116 | 118 | ||
117 | QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); | 119 | QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); |
118 | env << newRotation; | 120 | env << newRotation; |
119 | 121 | ||
120 | m_flipped = !m_flipped; | 122 | m_flipped = !m_flipped; |
121 | } | 123 | } |
122 | 124 | ||
123 | 125 | ||
124 | QRESULT RotateApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 126 | QRESULT RotateApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
125 | { | 127 | { |