Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 45 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 44 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 40 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 1 |
6 files changed, 50 insertions, 91 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 37c565b..dda039c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -335,47 +335,2 @@ void AudioWidget::timerEvent( QTimerEvent * ) { | |||
335 | 335 | ||
336 | |||
337 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | ||
338 | for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) { | ||
339 | Button &button = *it; | ||
340 | Command command = button.command; | ||
341 | |||
342 | if ( event->state() == QMouseEvent::LeftButton ) { | ||
343 | // The test to see if the mouse click is inside the button or not | ||
344 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command ); | ||
345 | |||
346 | if ( isOnButton && !button.isHeld ) { | ||
347 | button.isHeld = TRUE; | ||
348 | toggleButton( button ); | ||
349 | switch ( command ) { | ||
350 | case VolumeUp: | ||
351 | emit moreClicked(); | ||
352 | return; | ||
353 | case VolumeDown: | ||
354 | emit lessClicked(); | ||
355 | return; | ||
356 | case Forward: | ||
357 | emit forwardClicked(); | ||
358 | return; | ||
359 | case Back: | ||
360 | emit backClicked(); | ||
361 | return; | ||
362 | default: break; | ||
363 | } | ||
364 | } else if ( !isOnButton && button.isHeld ) { | ||
365 | button.isHeld = FALSE; | ||
366 | toggleButton( button ); | ||
367 | } | ||
368 | } else { | ||
369 | if ( button.isHeld ) { | ||
370 | button.isHeld = FALSE; | ||
371 | if ( button.type != ToggleButton ) { | ||
372 | setToggleButton( button, FALSE ); | ||
373 | } | ||
374 | handleCommand( command, button.isDown ); | ||
375 | } | ||
376 | } | ||
377 | } | ||
378 | } | ||
379 | |||
380 | |||
381 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | 336 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 9b276b5..690d1b3 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -71,6 +71,2 @@ public: | |||
71 | signals: | 71 | signals: |
72 | void moreClicked(); | ||
73 | void lessClicked(); | ||
74 | void forwardClicked(); | ||
75 | void backClicked(); | ||
76 | void sliderMoved(long); | 72 | void sliderMoved(long); |
@@ -82,3 +78,2 @@ protected: | |||
82 | void resizeEvent( QResizeEvent *re ); | 78 | void resizeEvent( QResizeEvent *re ); |
83 | void mouseMoveEvent( QMouseEvent *event ); | ||
84 | void mousePressEvent( QMouseEvent *event ); | 79 | void mousePressEvent( QMouseEvent *event ); |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 7eb75e6..3533d74 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -71,2 +71,46 @@ void MediaWidget::paintEvent( QPaintEvent *pe ) | |||
71 | 71 | ||
72 | void MediaWidget::mouseMoveEvent( QMouseEvent *event ) | ||
73 | { | ||
74 | for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) { | ||
75 | Button &button = *it; | ||
76 | Command command = button.command; | ||
77 | |||
78 | if ( event->state() == QMouseEvent::LeftButton ) { | ||
79 | // The test to see if the mouse click is inside the button or not | ||
80 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command ); | ||
81 | |||
82 | if ( isOnButton && !button.isHeld ) { | ||
83 | button.isHeld = TRUE; | ||
84 | toggleButton( button ); | ||
85 | switch ( command ) { | ||
86 | case VolumeUp: | ||
87 | emit moreClicked(); | ||
88 | return; | ||
89 | case VolumeDown: | ||
90 | emit lessClicked(); | ||
91 | return; | ||
92 | case Forward: | ||
93 | emit forwardClicked(); | ||
94 | return; | ||
95 | case Back: | ||
96 | emit backClicked(); | ||
97 | return; | ||
98 | default: break; | ||
99 | } | ||
100 | } else if ( !isOnButton && button.isHeld ) { | ||
101 | button.isHeld = FALSE; | ||
102 | toggleButton( button ); | ||
103 | } | ||
104 | } else { | ||
105 | if ( button.isHeld ) { | ||
106 | button.isHeld = FALSE; | ||
107 | if ( button.type != ToggleButton ) { | ||
108 | setToggleButton( button, FALSE ); | ||
109 | } | ||
110 | handleCommand( command, button.isDown ); | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | } | ||
115 | |||
72 | void MediaWidget::makeVisible() | 116 | void MediaWidget::makeVisible() |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 3f4c45d..c19fdbb 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -79,2 +79,6 @@ signals: | |||
79 | void backReleased(); | 79 | void backReleased(); |
80 | void forwardClicked(); | ||
81 | void backClicked(); | ||
82 | void moreClicked(); | ||
83 | void lessClicked(); | ||
80 | 84 | ||
@@ -85,2 +89,4 @@ protected: | |||
85 | 89 | ||
90 | virtual void mouseMoveEvent( QMouseEvent *event ); | ||
91 | |||
86 | virtual void makeVisible(); | 92 | virtual void makeVisible(); |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index cc586cc..41844e1 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -245,42 +245,2 @@ void VideoWidget::updateSlider( long i, long max ) { | |||
245 | 245 | ||
246 | void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | ||
247 | for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) { | ||
248 | Button &button = *it; | ||
249 | Command command = button.command; | ||
250 | |||
251 | if ( event->state() == QMouseEvent::LeftButton ) { | ||
252 | // The test to see if the mouse click is inside the button or not | ||
253 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command ); | ||
254 | |||
255 | if ( isOnButton && !button.isHeld ) { | ||
256 | button.isHeld = TRUE; | ||
257 | toggleButton( button ); | ||
258 | |||
259 | switch ( command ) { | ||
260 | case VolumeUp: | ||
261 | emit moreClicked(); | ||
262 | return; | ||
263 | case VolumeDown: | ||
264 | emit lessClicked(); | ||
265 | return; | ||
266 | default: break; | ||
267 | } | ||
268 | } else if ( !isOnButton && button.isHeld ) { | ||
269 | button.isHeld = FALSE; | ||
270 | toggleButton( button ); | ||
271 | } | ||
272 | } else { | ||
273 | |||
274 | if ( button.isHeld ) { | ||
275 | button.isHeld = FALSE; | ||
276 | if ( button.type != ToggleButton ) { | ||
277 | setToggleButton( button, FALSE ); | ||
278 | } | ||
279 | |||
280 | handleCommand( command, button.isDown ); | ||
281 | } | ||
282 | } | ||
283 | } | ||
284 | } | ||
285 | |||
286 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { | 246 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index ef88186..7d50ea0 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -78,3 +78,2 @@ protected: | |||
78 | void showEvent( QShowEvent *se ); | 78 | void showEvent( QShowEvent *se ); |
79 | void mouseMoveEvent( QMouseEvent *event ); | ||
80 | void mousePressEvent( QMouseEvent *event ); | 79 | void mousePressEvent( QMouseEvent *event ); |