#define MAX_BG_SIZE 400
#define MIN_BG_SIZE 64
-BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) :
- QWidget( NULL ), p_intf( _p_i )
+BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
+ :QWidget( NULL ), p_intf( _p_i )
{
/* We should use that one to take the more size it can */
- setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
+// setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
/* A dark background */
setAutoFillBackground( true );
backgroundLayout->setColumnStretch( 2, 1 );
CONNECT( THEMIM->getIM(), artChanged( QString ), this, update( QString ) );
- resize( 300, 150 );
}
BackgroundWidget::~BackgroundWidget()
{
}
+void BackgroundWidget::resizeEvent( QResizeEvent * event )
+{
+ if( event->size().height() <= MIN_BG_SIZE )
+ label->hide();
+ else
+ label->show();
+}
+
void BackgroundWidget::update( QString url )
{
if( url.isNull() )
CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
CONNECT( THEMIM, volumeChanged( void ), this, updateVolume( void ) );
- CONNECT( THEMIM->getIM(), statusChanged( int ), this, updateInput() );
updateInput();
}
SpeedControlWidget::~SpeedControlWidget()
{}
+void SpeedControlWidget::setEnable( bool b_enable )
+{
+ speedSlider->setEnabled( b_enable );
+}
+
void SpeedControlWidget::mouseDoubleClickEvent( QMouseEvent * event )
{
resetRate();
{
/* Forward the status to the controls to toggle Play/Pause */
controls->setStatus( status );
+
+ controls->updateInput();
+ speedControl->setEnable( THEMIM->getIM()->hasInput() );
+
/* And in the systray for the menu */
if( sysTray )
QVLCMenu::updateSystrayMenu( this, p_intf );