author | simon <simon> | 2002-12-08 22:58:45 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-08 22:58:45 (UTC) |
commit | 7b38c0424eca2f49a0c9a931766c816e21f1d86b (patch) (unidiff) | |
tree | e310c27ad3592e46fc1a46d963ae24b2f299c949 | |
parent | df6b6a0222e99736284ed8ebb9a7d8068751339b (diff) | |
download | opie-7b38c0424eca2f49a0c9a931766c816e21f1d86b.zip opie-7b38c0424eca2f49a0c9a931766c816e21f1d86b.tar.gz opie-7b38c0424eca2f49a0c9a931766c816e21f1d86b.tar.bz2 |
- merged the two duplicated toggleButton methods into a shared one
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 1 |
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 | |||
336 | void AudioWidget::toggleButton( int i ) { | ||
337 | buttons[i].isDown = !buttons[i].isDown; | ||
338 | QPainter p(this); | ||
339 | paintButton ( p, i ); | ||
340 | } | ||
341 | |||
342 | |||
343 | void AudioWidget::paintButton( QPainter &p, int i ) { | 335 | void 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(); |
93 | private: | 93 | private: |
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 | ||
71 | void MediaWidget::repaintButton( int buttonId ) | 71 | void 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 | ||
77 | void 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 | ||
266 | void VideoWidget::toggleButton( int i ) { | ||
267 | buttons[i].isDown = !buttons[i].isDown; | ||
268 | QPainter p(this); | ||
269 | paintButton ( p, i ); | ||
270 | } | ||
271 | |||
272 | void VideoWidget::paintButton( QPainter &p, int i ) { | 266 | void 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 | ||