author | simon <simon> | 2002-12-14 17:30:26 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-14 17:30:26 (UTC) |
commit | a3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476 (patch) (unidiff) | |
tree | dde78606067af08f0e3ac8f6ccabff2661b99d08 /noncore/multimedia/opieplayer2/videowidget.cpp | |
parent | bbdeff25bd0cc5ff59d52fd8bf25cdfbeac8f251 (diff) | |
download | opie-a3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476.zip opie-a3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476.tar.gz opie-a3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476.tar.bz2 |
- kill the flickery when painting. backgroundmode is now always
NoBackground and we do full double-buffering in the paintEvent
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 2300630..755cd22 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -155,26 +155,24 @@ void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType ) | |||
155 | } | 155 | } |
156 | 156 | ||
157 | // Effectively blank the view next time we show it so it looks nicer | 157 | // Effectively blank the view next time we show it so it looks nicer |
158 | scaledWidth = 0; | 158 | scaledWidth = 0; |
159 | scaledHeight = 0; | 159 | scaledHeight = 0; |
160 | hide(); | 160 | hide(); |
161 | } | 161 | } |
162 | 162 | ||
163 | void VideoWidget::loadSkin() | 163 | void VideoWidget::loadSkin() |
164 | { | 164 | { |
165 | loadDefaultSkin( guiInfo() ); | 165 | loadDefaultSkin( guiInfo() ); |
166 | 166 | ||
167 | setBackgroundPixmap( backgroundPixmap ); | ||
168 | |||
169 | delete slider; | 167 | delete slider; |
170 | slider = new QSlider( Qt::Horizontal, this ); | 168 | slider = new QSlider( Qt::Horizontal, this ); |
171 | slider->setMinValue( 0 ); | 169 | slider->setMinValue( 0 ); |
172 | slider->setMaxValue( 1 ); | 170 | slider->setMaxValue( 1 ); |
173 | slider->setBackgroundPixmap( backgroundPixmap ); | 171 | slider->setBackgroundPixmap( backgroundPixmap ); |
174 | //slider->setFocusPolicy( QWidget::NoFocus ); | 172 | //slider->setFocusPolicy( QWidget::NoFocus ); |
175 | 173 | ||
176 | resizeEvent( 0 ); | 174 | resizeEvent( 0 ); |
177 | } | 175 | } |
178 | 176 | ||
179 | void VideoWidget::updateSlider( long i, long max ) { | 177 | void VideoWidget::updateSlider( long i, long max ) { |
180 | // Will flicker too much if we don't do this | 178 | // Will flicker too much if we don't do this |
@@ -200,39 +198,37 @@ void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { | |||
200 | } | 198 | } |
201 | MediaWidget::mouseReleaseEvent( event ); | 199 | MediaWidget::mouseReleaseEvent( event ); |
202 | } | 200 | } |
203 | 201 | ||
204 | void VideoWidget::backToNormal() { | 202 | void VideoWidget::backToNormal() { |
205 | mediaPlayerState.setFullscreen( FALSE ); | 203 | mediaPlayerState.setFullscreen( FALSE ); |
206 | makeVisible(); | 204 | makeVisible(); |
207 | setToggleButton( FullScreen, false ); | 205 | setToggleButton( FullScreen, false ); |
208 | } | 206 | } |
209 | 207 | ||
210 | void VideoWidget::makeVisible() { | 208 | void VideoWidget::makeVisible() { |
211 | if ( mediaPlayerState.isFullscreen() ) { | 209 | if ( mediaPlayerState.isFullscreen() ) { |
212 | setBackgroundMode( QWidget::NoBackground ); | ||
213 | showFullScreen(); | 210 | showFullScreen(); |
214 | resize( qApp->desktop()->size() ); | 211 | resize( qApp->desktop()->size() ); |
215 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 212 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
216 | 213 | ||
217 | slider->hide(); | 214 | slider->hide(); |
218 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 215 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
219 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 216 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
220 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 217 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
221 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 218 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
222 | 219 | ||
223 | } else { | 220 | } else { |
224 | showNormal(); | 221 | showNormal(); |
225 | showMaximized(); | 222 | showMaximized(); |
226 | setBackgroundPixmap( backgroundPixmap ); | ||
227 | QWidget *d = QApplication::desktop(); | 223 | QWidget *d = QApplication::desktop(); |
228 | int w = d->width(); | 224 | int w = d->width(); |
229 | int h = d->height(); | 225 | int h = d->height(); |
230 | 226 | ||
231 | if(w>h) { | 227 | if(w>h) { |
232 | int newW=(w/2)-(246/2); //this will only work with 320x240 | 228 | int newW=(w/2)-(246/2); //this will only work with 320x240 |
233 | videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); | 229 | videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); |
234 | } else { | 230 | } else { |
235 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); | 231 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); |
236 | } | 232 | } |
237 | 233 | ||
238 | if ( !mediaPlayerState.isSeekable() ) { | 234 | if ( !mediaPlayerState.isSeekable() ) { |