author | kergoth <kergoth> | 2003-04-15 03:04:15 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-04-15 03:04:15 (UTC) |
commit | a0dd69741995f33de4eea6a5f97f46b91dff4cb8 (patch) (unidiff) | |
tree | 2214fb9416b1914355d438cd5d0200b51d1fd2f4 | |
parent | f1379d479d192f8c1dc99cd982aaaf545c4867f6 (diff) | |
download | opie-a0dd69741995f33de4eea6a5f97f46b91dff4cb8.zip opie-a0dd69741995f33de4eea6a5f97f46b91dff4cb8.tar.gz opie-a0dd69741995f33de4eea6a5f97f46b91dff4cb8.tar.bz2 |
Add a third rotation direction, for 180 degree.
-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 10 | ||||
-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 24 | ||||
-rw-r--r-- | noncore/settings/appearance2/appearance.h | 1 |
3 files changed, 26 insertions, 9 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 | |||
@@ -99,3 +99,3 @@ void RotateApplet::activated ( ) | |||
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 | ||
@@ -109,7 +109,9 @@ void RotateApplet::activated ( ) | |||
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 | } | 114 | } else { |
115 | newRotation = ( defaultRotation + 180 ) % 360; | ||
116 | } | ||
115 | } | 117 | } |
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index 32234f0..83532de 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp | |||
@@ -411,2 +411,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
411 | QPixmap ccw1; | 411 | QPixmap ccw1; |
412 | m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" ); | ||
413 | QPixmap flip1 = Resource::loadIconSet("pass"). pixmap( ); | ||
412 | QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); | 414 | QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); |
@@ -417,2 +419,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
417 | rotbtngrp-> insert ( m_rotdir_ccw ); | 419 | rotbtngrp-> insert ( m_rotdir_ccw ); |
420 | rotbtngrp-> insert ( m_rotdir_flip ); | ||
418 | 421 | ||
@@ -421,2 +424,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
421 | m_rotdir_ccw-> setPixmap( ccw1 ); | 424 | m_rotdir_ccw-> setPixmap( ccw1 ); |
425 | m_rotdir_flip-> setPixmap( flip1 ); | ||
422 | 426 | ||
@@ -425,6 +429,8 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
425 | rotLay-> addWidget ( m_rotdir_ccw, 0 ); | 429 | rotLay-> addWidget ( m_rotdir_ccw, 0 ); |
430 | rotLay-> addWidget ( m_rotdir_flip, 0 ); | ||
426 | 431 | ||
427 | bool rotcw = !(cfg. readBoolEntry ( "rotatedir", 0 )); | 432 | int rot = cfg. readNumEntry ( "rotatedir", 0 ); |
428 | m_rotdir_cw-> setChecked ( rotcw ); | 433 | m_rotdir_cw-> setChecked ( rot == 0 ); |
429 | m_rotdir_ccw-> setChecked ( !rotcw ); | 434 | m_rotdir_ccw-> setChecked ( rot == 1 ); |
435 | m_rotdir_flip-> setChecked ( rot == 2 ); | ||
430 | 436 | ||
@@ -485,3 +491,2 @@ void Appearance::accept ( ) | |||
485 | bool newtabpos = m_tabstyle_top-> isChecked ( ); | 491 | bool newtabpos = m_tabstyle_top-> isChecked ( ); |
486 | bool is_rotdir_ccw = m_rotdir_ccw-> isChecked ( ); | ||
487 | int newtabstyle = m_tabstyle_list-> currentItem ( ); | 492 | int newtabstyle = m_tabstyle_list-> currentItem ( ); |
@@ -523,3 +528,12 @@ void Appearance::accept ( ) | |||
523 | 528 | ||
524 | config. writeEntry ( "rotatedir", is_rotdir_ccw ); | 529 | bool is_rotdir_ccw = m_rotdir_ccw-> isChecked ( ); |
530 | int rotval; | ||
531 | if (m_rotdir_ccw-> isChecked ( )) { | ||
532 | rotval = 1; | ||
533 | } else if (m_rotdir_cw-> isChecked ( )) { | ||
534 | rotval = 0; | ||
535 | } else { | ||
536 | rotval = 2; | ||
537 | } | ||
538 | config. writeEntry ( "rotatedir", rotval ); | ||
525 | 539 | ||
diff --git a/noncore/settings/appearance2/appearance.h b/noncore/settings/appearance2/appearance.h index 0e42298..da9e976 100644 --- a/noncore/settings/appearance2/appearance.h +++ b/noncore/settings/appearance2/appearance.h | |||
@@ -119,2 +119,3 @@ private: | |||
119 | QRadioButton *m_rotdir_ccw; | 119 | QRadioButton *m_rotdir_ccw; |
120 | QRadioButton *m_rotdir_flip; | ||
120 | 121 | ||