author | cniehaus <cniehaus> | 2002-12-01 13:22:33 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-12-01 13:22:33 (UTC) |
commit | bd476ac2563bee270f79c8db995b8e1e08eec77f (patch) (unidiff) | |
tree | eca7a45424bdcef8240012684cad605f45f43f84 | |
parent | 5e82b4c17131cdc1b8be57e312f594d1a55520aa (diff) | |
download | opie-bd476ac2563bee270f79c8db995b8e1e08eec77f.zip opie-bd476ac2563bee270f79c8db995b8e1e08eec77f.tar.gz opie-bd476ac2563bee270f79c8db995b8e1e08eec77f.tar.bz2 |
perhaps tille finds some time for debugging this
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 13 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.h | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp index eb4093b..d7126b9 100644 --- a/noncore/apps/oxygen/psewidget.cpp +++ b/noncore/apps/oxygen/psewidget.cpp | |||
@@ -39,16 +39,17 @@ PSEWidget::PSEWidget() : QWidget() | |||
39 | configobj.setGroup( QString::number( n+1 )); | 39 | configobj.setGroup( QString::number( n+1 )); |
40 | 40 | ||
41 | position( n+1,h,v ); | 41 | position( n+1,h,v ); |
42 | PSEframe.append( new OxyFrame( this , QString::number(n), configobj.readEntry( "Symbol" ) ) ); | 42 | PSEframe.append( new OxyFrame( this , QString::number(n), configobj.readEntry( "Symbol" ) ) ); |
43 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); | 43 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); |
44 | PSEframe.current()->setMinimumHeight( 11 ); | 44 | PSEframe.current()->setMinimumHeight( 11 ); |
45 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); | 45 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); |
46 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); | 46 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); |
47 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( inverseColor(QString) )); | ||
47 | } | 48 | } |
48 | 49 | ||
49 | oxyDW = new OxydataWidget(this); | 50 | oxyDW = new OxydataWidget(this); |
50 | oxyDW->setElement( 0 ); | 51 | oxyDW->setElement( 0 ); |
51 | oxyDW->setLayout(); | 52 | oxyDW->setLayout(); |
52 | 53 | ||
53 | vlay->addLayout( grid ); | 54 | vlay->addLayout( grid ); |
54 | vlay->addWidget( oxyDW ); | 55 | vlay->addWidget( oxyDW ); |
@@ -61,17 +62,27 @@ QColor PSEWidget::PSEColor( QString block ) | |||
61 | else if ( block == "d" ) c.setRgb( 200,230,160 ); | 62 | else if ( block == "d" ) c.setRgb( 200,230,160 ); |
62 | else if ( block == "p" ) c.setRgb( 238,146,138 ); | 63 | else if ( block == "p" ) c.setRgb( 238,146,138 ); |
63 | else if ( block == "f" ) c.setRgb( 190 , 190 , 190 ); | 64 | else if ( block == "f" ) c.setRgb( 190 , 190 , 190 ); |
64 | return c; | 65 | return c; |
65 | }; | 66 | }; |
66 | 67 | ||
67 | void PSEWidget::inverseColor( QString number ) | 68 | void PSEWidget::inverseColor( QString number ) |
68 | { | 69 | { |
69 | //foo | 70 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); |
71 | configobj.setGroup( number ); | ||
72 | QString block = configobj.readEntry( "Block" ); | ||
73 | QColor c; | ||
74 | if ( block == "s" ) c.setRgb( 213 , 233 , 231 ); | ||
75 | else if ( block == "d" ) c.setRgb( 200,230,160 ); | ||
76 | else if ( block == "p" ) c.setRgb( 238,146,138 ); | ||
77 | else if ( block == "f" ) c.setRgb( 190 , 190 , 190 ); | ||
78 | c.dark(); | ||
79 | |||
80 | PSEframe.at( number.toUInt() )->setPalette( QPalette( c ) ); | ||
70 | } | 81 | } |
71 | 82 | ||
72 | void PSEWidget::slotShowElement(QString number) | 83 | void PSEWidget::slotShowElement(QString number) |
73 | { | 84 | { |
74 | oxyDW->setElement( number.toInt() ); | 85 | oxyDW->setElement( number.toInt() ); |
75 | }; | 86 | }; |
76 | 87 | ||
77 | void PSEWidget::position(int n, int& h, int& v) | 88 | void PSEWidget::position(int n, int& h, int& v) |
diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h index d8d2c5f..cfb629d 100644 --- a/noncore/apps/oxygen/psewidget.h +++ b/noncore/apps/oxygen/psewidget.h | |||
@@ -29,23 +29,23 @@ class PSEWidget : public QWidget | |||
29 | { | 29 | { |
30 | Q_OBJECT | 30 | Q_OBJECT |
31 | 31 | ||
32 | public: | 32 | public: |
33 | PSEWidget(); | 33 | PSEWidget(); |
34 | QGridLayout *bottom_grid; | 34 | QGridLayout *bottom_grid; |
35 | OxydataWidget *oxyDW; | 35 | OxydataWidget *oxyDW; |
36 | 36 | ||
37 | void inverseColor( QString ); | ||
38 | QList<OxyFrame> PSEframe; | 37 | QList<OxyFrame> PSEframe; |
39 | 38 | ||
40 | private: | 39 | private: |
41 | QGridLayout *maingrid; | 40 | QGridLayout *maingrid; |
42 | 41 | ||
43 | void position( int, int&, int& ); | 42 | void position( int, int&, int& ); |
44 | QColor PSEColor( QString ); | 43 | QColor PSEColor( QString ); |
45 | 44 | ||
46 | public slots: | 45 | public slots: |
47 | void slotShowElement(QString); | 46 | void slotShowElement(QString); |
47 | void inverseColor( QString ); | ||
48 | 48 | ||
49 | }; | 49 | }; |
50 | 50 | ||
51 | #endif | 51 | #endif |