mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-08 11:26:59 +02:00
Qt4 - small fixes... Remove one redondant connect, block the access to the speedSlider if there is no input.
This commit is contained in:
parent
e1bc46e792
commit
19a891e281
@ -148,11 +148,11 @@ QSize VideoWidget::sizeHint() const
|
||||
#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 );
|
||||
@ -179,13 +179,20 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) :
|
||||
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() )
|
||||
@ -613,7 +620,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
|
||||
CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
|
||||
CONNECT( THEMIM, volumeChanged( void ), this, updateVolume( void ) );
|
||||
|
||||
CONNECT( THEMIM->getIM(), statusChanged( int ), this, updateInput() );
|
||||
|
||||
updateInput();
|
||||
}
|
||||
@ -828,6 +834,11 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) :
|
||||
SpeedControlWidget::~SpeedControlWidget()
|
||||
{}
|
||||
|
||||
void SpeedControlWidget::setEnable( bool b_enable )
|
||||
{
|
||||
speedSlider->setEnabled( b_enable );
|
||||
}
|
||||
|
||||
void SpeedControlWidget::mouseDoubleClickEvent( QMouseEvent * event )
|
||||
{
|
||||
resetRate();
|
||||
|
@ -91,7 +91,7 @@ private:
|
||||
QLabel *label;
|
||||
virtual void contextMenuEvent( QContextMenuEvent *event );
|
||||
intf_thread_t *p_intf;
|
||||
|
||||
virtual void resizeEvent( QResizeEvent * event );
|
||||
public slots:
|
||||
void toggle(){ TOGGLEV( this ); }
|
||||
void update( QString );
|
||||
@ -252,6 +252,8 @@ protected:
|
||||
private:
|
||||
intf_thread_t *p_intf;
|
||||
QSlider *speedSlider;
|
||||
public slots:
|
||||
void setEnable( bool );
|
||||
private slots:
|
||||
void updateRate( int );
|
||||
void resetRate();
|
||||
|
@ -904,6 +904,10 @@ void MainInterface::setStatus( int status )
|
||||
{
|
||||
/* 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 );
|
||||
|
Loading…
Reference in New Issue
Block a user