Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 8f6a8a9..db4a396 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -221,54 +221,48 @@ void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType ) | |||
221 | 221 | ||
222 | // Effectively blank the view next time we show it so it looks nicer | 222 | // Effectively blank the view next time we show it so it looks nicer |
223 | scaledWidth = 0; | 223 | scaledWidth = 0; |
224 | scaledHeight = 0; | 224 | scaledHeight = 0; |
225 | hide(); | 225 | hide(); |
226 | } | 226 | } |
227 | 227 | ||
228 | void VideoWidget::updateSlider( long i, long max ) { | 228 | void VideoWidget::updateSlider( long i, long max ) { |
229 | // Will flicker too much if we don't do this | 229 | // Will flicker too much if we don't do this |
230 | if ( max == 0 ) { | 230 | if ( max == 0 ) { |
231 | return; | 231 | return; |
232 | } | 232 | } |
233 | int width = slider->width(); | 233 | int width = slider->width(); |
234 | int val = int((double)i * width / max); | 234 | int val = int((double)i * width / max); |
235 | if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) { | 235 | if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) { |
236 | if ( slider->value() != val ) { | 236 | if ( slider->value() != val ) { |
237 | slider->setValue( val ); | 237 | slider->setValue( val ); |
238 | } | 238 | } |
239 | if ( slider->maxValue() != width ) { | 239 | if ( slider->maxValue() != width ) { |
240 | slider->setMaxValue( width ); | 240 | slider->setMaxValue( width ); |
241 | } | 241 | } |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | void VideoWidget::setToggleButton( int i, bool down ) { | ||
246 | if ( down != buttons[i].isDown ) { | ||
247 | toggleButton( i ); | ||
248 | } | ||
249 | } | ||
250 | |||
251 | void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | 245 | void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { |
252 | for ( unsigned int i = 0; i < buttons.count(); i++ ) { | 246 | for ( unsigned int i = 0; i < buttons.count(); i++ ) { |
253 | if ( event->state() == QMouseEvent::LeftButton ) { | 247 | if ( event->state() == QMouseEvent::LeftButton ) { |
254 | // The test to see if the mouse click is inside the button or not | 248 | // The test to see if the mouse click is inside the button or not |
255 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); | 249 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); |
256 | 250 | ||
257 | if ( isOnButton && !buttons[i].isHeld ) { | 251 | if ( isOnButton && !buttons[i].isHeld ) { |
258 | buttons[i].isHeld = TRUE; | 252 | buttons[i].isHeld = TRUE; |
259 | toggleButton(i); | 253 | toggleButton(i); |
260 | 254 | ||
261 | switch (i) { | 255 | switch (i) { |
262 | case VideoVolUp: | 256 | case VideoVolUp: |
263 | emit moreClicked(); | 257 | emit moreClicked(); |
264 | return; | 258 | return; |
265 | case VideoVolDown: | 259 | case VideoVolDown: |
266 | emit lessClicked(); | 260 | emit lessClicked(); |
267 | return; | 261 | return; |
268 | } | 262 | } |
269 | } else if ( !isOnButton && buttons[i].isHeld ) { | 263 | } else if ( !isOnButton && buttons[i].isHeld ) { |
270 | buttons[i].isHeld = FALSE; | 264 | buttons[i].isHeld = FALSE; |
271 | toggleButton(i); | 265 | toggleButton(i); |
272 | } | 266 | } |
273 | } else { | 267 | } else { |
274 | 268 | ||