CVS commit by neil: Grow to a decent size when a video is first played M +21 -2 view.cpp 1.10.2.2 M +3 -0 view.h 1.7.2.1 --- kdemultimedia/kaboodle/view.cpp:1.10.2.1 Fri Dec 6 16:22:47 2002 @@ -61,6 +61,8 @@ , autoPlay(false) , quitAfterPlaying(false) , player(p) + , firstVideo(false) + , lastWidth(0) { (new QHBoxLayout(this))->setAutoAdd(true); QVBox *box = new QVBox(this); @@ -151,8 +153,11 @@ pauseButton->setEnabled(false); // loaded - if(oldState == KMediaPlayer::Player::Empty && autoPlay) - player->play(); + if(oldState == KMediaPlayer::Player::Empty) + { + firstVideo = true; + if(autoPlay) player->play(); + } break; @@ -180,6 +185,19 @@ updateTicks(); + if(firstVideo) + { + if(!lastWidth) + { + video->setNormalSize(); + } + else + { + firstVideo = false; + lastWidth = 0; + } + } + if(player->isSeekable()) { slider->setEnabled(true); @@ -221,6 +239,7 @@ void Kaboodle::View::calculateSize(int newWidth, int newHeight) { + lastWidth = newWidth; int extraWidth = width() - video->width(); int extraHeight = height() - video->height(); newWidth += extraWidth; --- kdemultimedia/kaboodle/view.h:1.7 Tue Sep 17 10:13:18 2002 @@ -91,6 +91,9 @@ L33tSlider *slider; QLabel *elapsedLabel; KVideoWidget *video; + bool firstVideo; + + int lastWidth; QButton *playButton, *pauseButton, *stopButton; };