summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-08 22:58:45 (UTC)
committer simon <simon>2002-12-08 22:58:45 (UTC)
commit7b38c0424eca2f49a0c9a931766c816e21f1d86b (patch) (unidiff)
treee310c27ad3592e46fc1a46d963ae24b2f299c949
parentdf6b6a0222e99736284ed8ebb9a7d8068751339b (diff)
downloadopie-7b38c0424eca2f49a0c9a931766c816e21f1d86b.zip
opie-7b38c0424eca2f49a0c9a931766c816e21f1d86b.tar.gz
opie-7b38c0424eca2f49a0c9a931766c816e21f1d86b.tar.bz2
- merged the two duplicated toggleButton methods into a shared one
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp8
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp8
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h1
6 files changed, 9 insertions, 17 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 10b1e58..2a158a8 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -333,12 +333,4 @@ void AudioWidget::setToggleButton( int i, bool down ) {
333} 333}
334 334
335
336void AudioWidget::toggleButton( int i ) {
337 buttons[i].isDown = !buttons[i].isDown;
338 QPainter p(this);
339 paintButton ( p, i );
340}
341
342
343void AudioWidget::paintButton( QPainter &p, int i ) { 335void AudioWidget::paintButton( QPainter &p, int i ) {
344 if ( buttons[i].isDown ) { 336 if ( buttons[i].isDown ) {
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index a1a839c..4598d51 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -92,5 +92,4 @@ private slots:
92 void stopSkip(); 92 void stopSkip();
93private: 93private:
94 void toggleButton( int );
95 void setToggleButton( int, bool ); 94 void setToggleButton( int, bool );
96 virtual void paintButton( QPainter &p, int i ); 95 virtual void paintButton( QPainter &p, int i );
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index ca84019..62266ad 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -69,5 +69,5 @@ bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const
69} 69}
70 70
71void MediaWidget::repaintButton( int buttonId ) 71void MediaWidget::paintButton( int buttonId )
72{ 72{
73 QPainter p( this ); 73 QPainter p( this );
@@ -75,4 +75,10 @@ void MediaWidget::repaintButton( int buttonId )
75} 75}
76 76
77void MediaWidget::toggleButton( int buttonId )
78{
79 buttons[ buttonId ].isDown = !buttons[ buttonId ].isDown;
80 paintButton( buttonId );
81}
82
77/* vim: et sw=4 ts=4 83/* vim: et sw=4 ts=4
78 */ 84 */
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 066d2ac..46c304d 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -71,4 +71,6 @@ protected:
71 virtual void paintButton( QPainter &p, int i ) = 0; 71 virtual void paintButton( QPainter &p, int i ) = 0;
72 72
73 void toggleButton( int buttonId );
74
73 MediaPlayerState &mediaPlayerState; 75 MediaPlayerState &mediaPlayerState;
74 PlayListWidget &playList; 76 PlayListWidget &playList;
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 3e677c6..77eab71 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -264,10 +264,4 @@ void VideoWidget::setToggleButton( int i, bool down ) {
264} 264}
265 265
266void VideoWidget::toggleButton( int i ) {
267 buttons[i].isDown = !buttons[i].isDown;
268 QPainter p(this);
269 paintButton ( p, i );
270}
271
272void VideoWidget::paintButton( QPainter &p, int i ) { 266void VideoWidget::paintButton( QPainter &p, int i ) {
273 267
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index 28f720b..24e8741 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -109,5 +109,4 @@ private:
109 109
110 virtual void paintButton( QPainter &p, int i ); 110 virtual void paintButton( QPainter &p, int i );
111 void toggleButton( int );
112 void setToggleButton( int, bool ); 111 void setToggleButton( int, bool );
113 112