-rw-r--r-- | libqtaux/ocolorbutton.cpp | 50 | ||||
-rw-r--r-- | libqtaux/ocolorbutton.h | 44 |
2 files changed, 51 insertions, 43 deletions
diff --git a/libqtaux/ocolorbutton.cpp b/libqtaux/ocolorbutton.cpp index 004fafc..2a87be9 100644 --- a/libqtaux/ocolorbutton.cpp +++ b/libqtaux/ocolorbutton.cpp @@ -3,25 +3,25 @@ Copyright (C) Robert Griebl <sandman@handhelds.org> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software +- . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -91,7 +91,7 @@ QColor OColorButton::color ( ) const */ void OColorButton::setColor ( const QColor &c ) { - updateColor ( c ); + updateColor ( c, true ); } /** @@ -99,6 +99,11 @@ void OColorButton::setColor ( const QColor &c ) */ void OColorButton::updateColor ( const QColor &c ) { + updateColor( c, true ); +} + +void OColorButton::updateColor ( const QColor &c, bool sendSignal ) +{ d-> m_color = c; QImage img ( width()-14, height()-6, 32 ); @@ -143,7 +148,8 @@ void OColorButton::updateColor ( const QColor &c ) pix. convertFromImage ( img ); setPixmap ( pix ); - emit colorSelected ( c ); + if ( sendSignal ) + emit colorSelected ( c ); } @@ -152,5 +158,5 @@ void OColorButton::updateColor ( const QColor &c ) */ void OColorButton::resizeEvent( QResizeEvent *ev ) { QPushButton::resizeEvent( ev ); - updateColor(d->m_color); + updateColor( d->m_color, false ); } diff --git a/libqtaux/ocolorbutton.h b/libqtaux/ocolorbutton.h index 10b77d5..4845c0d 100644 --- a/libqtaux/ocolorbutton.h +++ b/libqtaux/ocolorbutton.h @@ -3,25 +3,25 @@ Copyright (C) Robert Griebl <sandman@handhelds.org> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software +- . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -54,9 +54,9 @@ public: virtual ~OColorButton ( ); QColor color ( ) const; - + protected: - void resizeEvent( QResizeEvent* ); + void resizeEvent( QResizeEvent* ); signals: /** @@ -75,6 +75,8 @@ protected slots: private: OColorButtonPrivate *d; + + void updateColor ( const QColor &, bool sendSignal = true ); }; }; |