-rw-r--r-- | noncore/apps/oxygen/calcdlg.ui | 4 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 24 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.h | 2 |
3 files changed, 17 insertions, 13 deletions
diff --git a/noncore/apps/oxygen/calcdlg.ui b/noncore/apps/oxygen/calcdlg.ui index c817a47..51bf334 100644 --- a/noncore/apps/oxygen/calcdlg.ui +++ b/noncore/apps/oxygen/calcdlg.ui @@ -17,6 +17,2 @@ </property> - <property stdset="1"> - <name>caption</name> - <string>Form1</string> - </property> <widget> diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp index d7126b9..d8e4086 100644 --- a/noncore/apps/oxygen/psewidget.cpp +++ b/noncore/apps/oxygen/psewidget.cpp @@ -29,2 +29,4 @@ PSEWidget::PSEWidget() : QWidget() this->setCaption( tr( "Periodic System" ) ); + + lastElement=1; @@ -67,3 +69,3 @@ QColor PSEWidget::PSEColor( QString block ) -void PSEWidget::inverseColor( QString number ) +void PSEWidget::inverseColor( QString number) { @@ -72,10 +74,14 @@ void PSEWidget::inverseColor( QString number ) QString block = configobj.readEntry( "Block" ); - QColor c; - if ( block == "s" ) c.setRgb( 213 , 233 , 231 ); - else if ( block == "d" ) c.setRgb( 200,230,160 ); - else if ( block == "p" ) c.setRgb( 238,146,138 ); - else if ( block == "f" ) c.setRgb( 190 , 190 , 190 ); - c.dark(); - - PSEframe.at( number.toUInt() )->setPalette( QPalette( c ) ); + QColor c, d; + c = PSEColor( block ); + d = c.dark(); + + PSEframe.at( number.toUInt() )->setPalette( QPalette( d ) ); + + configobj.setGroup( QString::number( lastElement+1 ) ); + block = configobj.readEntry( "Block" ); + c = PSEColor( block ); + PSEframe.at( lastElement )->setPalette( QPalette( c ) ); + + lastElement=number.toInt(); } diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h index cfb629d..ddeab9d 100644 --- a/noncore/apps/oxygen/psewidget.h +++ b/noncore/apps/oxygen/psewidget.h @@ -38,2 +38,4 @@ class PSEWidget : public QWidget + int lastElement; + private: |