summaryrefslogtreecommitdiff
path: root/noncore/apps/oxygen/psewidget.cpp
authorcniehaus <cniehaus>2002-09-20 12:13:58 (UTC)
committer cniehaus <cniehaus>2002-09-20 12:13:58 (UTC)
commite1c71743917aa6047c5ed7da6ca3a18024ceabde (patch) (side-by-side diff)
tree097c975669e3372973b46431a9cc02cda6210cc7 /noncore/apps/oxygen/psewidget.cpp
parentb1f3d33cb0b3f203f153074a8812d5988c3031b2 (diff)
downloadopie-e1c71743917aa6047c5ed7da6ca3a18024ceabde.zip
opie-e1c71743917aa6047c5ed7da6ca3a18024ceabde.tar.gz
opie-e1c71743917aa6047c5ed7da6ca3a18024ceabde.tar.bz2
fixing the colors. THis looks almost cool :)
Diffstat (limited to 'noncore/apps/oxygen/psewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/psewidget.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp
index f7725e3..78e54d5 100644
--- a/noncore/apps/oxygen/psewidget.cpp
+++ b/noncore/apps/oxygen/psewidget.cpp
@@ -20,29 +20,44 @@ PSEWidget::PSEWidget() : QWidget()
this->setCaption( tr( "Periodic System" ) );
QVBoxLayout *vlay = new QVBoxLayout( this );
QGridLayout *grid = new QGridLayout( 18,10 );
int h=0, v=0;
+
+ Config configobj( "oxygendata" );
for( int n = 0 ; n < 118 ; n++ )
{
+ configobj.setGroup( QString::number( n+1 ));
+
position( n+1,h,v );
QList<OxyFrame> PSEframe;
PSEframe.append( new OxyFrame( this , QString::number(n) ) );
grid->addWidget( PSEframe.current() , v/40+1 , h/40 );
PSEframe.current()->setMinimumHeight( 11 );
+ PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) );
connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) ));
}
oxyDW = new OxydataWidget(this);
oxyDW->setElement( 1 );
vlay->addLayout( grid );
vlay->addWidget( oxyDW );
}
+QColor PSEWidget::PSEColor( QString 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 );
+ return c;
+};
+
void PSEWidget::slotShowElement(QString number)
{
oxyDW->setElement( number.toInt() );
};
void PSEWidget::position(int n, int& h, int& v)