summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 2a345e3..2300630 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -159,96 +159,97 @@ void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType )
159 scaledHeight = 0; 159 scaledHeight = 0;
160 hide(); 160 hide();
161} 161}
162 162
163void VideoWidget::loadSkin() 163void VideoWidget::loadSkin()
164{ 164{
165 loadDefaultSkin( guiInfo() ); 165 loadDefaultSkin( guiInfo() );
166 166
167 setBackgroundPixmap( backgroundPixmap ); 167 setBackgroundPixmap( backgroundPixmap );
168 168
169 delete slider; 169 delete slider;
170 slider = new QSlider( Qt::Horizontal, this ); 170 slider = new QSlider( Qt::Horizontal, this );
171 slider->setMinValue( 0 ); 171 slider->setMinValue( 0 );
172 slider->setMaxValue( 1 ); 172 slider->setMaxValue( 1 );
173 slider->setBackgroundPixmap( backgroundPixmap ); 173 slider->setBackgroundPixmap( backgroundPixmap );
174 //slider->setFocusPolicy( QWidget::NoFocus ); 174 //slider->setFocusPolicy( QWidget::NoFocus );
175 175
176 resizeEvent( 0 ); 176 resizeEvent( 0 );
177} 177}
178 178
179void VideoWidget::updateSlider( long i, long max ) { 179void VideoWidget::updateSlider( long i, long max ) {
180 // Will flicker too much if we don't do this 180 // Will flicker too much if we don't do this
181 if ( max == 0 ) { 181 if ( max == 0 ) {
182 return; 182 return;
183 } 183 }
184 int width = slider->width(); 184 int width = slider->width();
185 int val = int((double)i * width / max); 185 int val = int((double)i * width / max);
186 if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) { 186 if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) {
187 if ( slider->value() != val ) { 187 if ( slider->value() != val ) {
188 slider->setValue( val ); 188 slider->setValue( val );
189 } 189 }
190 if ( slider->maxValue() != width ) { 190 if ( slider->maxValue() != width ) {
191 slider->setMaxValue( width ); 191 slider->setMaxValue( width );
192 } 192 }
193 } 193 }
194} 194}
195 195
196void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { 196void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) {
197 if ( mediaPlayerState.isFullscreen() ) { 197 if ( mediaPlayerState.isFullscreen() ) {
198 mediaPlayerState.setFullscreen( FALSE ); 198 mediaPlayerState.setFullscreen( FALSE );
199 makeVisible(); 199 makeVisible();
200 } 200 }
201 MediaWidget::mouseReleaseEvent( event ); 201 MediaWidget::mouseReleaseEvent( event );
202} 202}
203 203
204void VideoWidget::backToNormal() { 204void VideoWidget::backToNormal() {
205 mediaPlayerState.setFullscreen( FALSE ); 205 mediaPlayerState.setFullscreen( FALSE );
206 makeVisible(); 206 makeVisible();
207 setToggleButton( FullScreen, false );
207} 208}
208 209
209void VideoWidget::makeVisible() { 210void VideoWidget::makeVisible() {
210 if ( mediaPlayerState.isFullscreen() ) { 211 if ( mediaPlayerState.isFullscreen() ) {
211 setBackgroundMode( QWidget::NoBackground ); 212 setBackgroundMode( QWidget::NoBackground );
212 showFullScreen(); 213 showFullScreen();
213 resize( qApp->desktop()->size() ); 214 resize( qApp->desktop()->size() );
214 videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); 215 videoFrame-> setGeometry ( 0, 0, width ( ), height ( ));
215 216
216 slider->hide(); 217 slider->hide();
217 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 218 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
218 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 219 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
219 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 220 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
220 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 221 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
221 222
222 } else { 223 } else {
223 showNormal(); 224 showNormal();
224 showMaximized(); 225 showMaximized();
225 setBackgroundPixmap( backgroundPixmap ); 226 setBackgroundPixmap( backgroundPixmap );
226 QWidget *d = QApplication::desktop(); 227 QWidget *d = QApplication::desktop();
227 int w = d->width(); 228 int w = d->width();
228 int h = d->height(); 229 int h = d->height();
229 230
230 if(w>h) { 231 if(w>h) {
231 int newW=(w/2)-(246/2); //this will only work with 320x240 232 int newW=(w/2)-(246/2); //this will only work with 320x240
232 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); 233 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) );
233 } else { 234 } else {
234 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); 235 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) );
235 } 236 }
236 237
237 if ( !mediaPlayerState.isSeekable() ) { 238 if ( !mediaPlayerState.isSeekable() ) {
238 if( !slider->isHidden()) { 239 if( !slider->isHidden()) {
239 slider->hide(); 240 slider->hide();
240 } 241 }
241 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 242 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
242 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 243 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
243 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 244 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
244 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 245 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
245 } else { 246 } else {
246 slider->show(); 247 slider->show();
247 connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 248 connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
248 connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 249 connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
249 connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 250 connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
250 connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 251 connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
251 } 252 }
252 } 253 }
253} 254}
254 255