void DroppingController::resetLine( const QString& line ) { hide(); QLayoutItem *child; while( (child = controlLayout->takeAt( 0 ) ) != 0 ) { child->widget()->hide(); delete child; } parseAndCreate( line, controlLayout ); show(); }
InputControlsWidget::InputControlsWidget( intf_thread_t *_p_i, QWidget *_parent ) : AbstractController( _p_i, _parent ) { RTL_UNAFFECTED_WIDGET controlLayout = new QHBoxLayout( this ); controlLayout->setMargin( 0 ); controlLayout->setSpacing( 0 ); #ifdef DEBUG_LAYOUT setStyleSheet( "background: green "); #endif QString line = getSettings()->value( "MainWindow/InputToolbar", INPT_TB_DEFAULT ).toString(); parseAndCreate( line, controlLayout ); }
/***************************** * DA Control Widget ! *****************************/ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls, QWidget *_parent ) : AbstractController( _p_i, _parent ) { RTL_UNAFFECTED_WIDGET /* advanced Controls handling */ b_advancedVisible = b_advControls; #ifdef DEBUG_LAYOUT setStyleSheet( "background: red "); #endif setAttribute( Qt::WA_MacBrushedMetal); controlLayout = new QVBoxLayout( this ); controlLayout->setContentsMargins( 3, 1, 0, 1 ); controlLayout->setSpacing( 0 ); QHBoxLayout *controlLayout1 = new QHBoxLayout; controlLayout1->setSpacing( 0 ); controlLayout1->setMargin( 0 ); QString line1 = getSettings()->value( "MainWindow/MainToolbar1", MAIN_TB1_DEFAULT ) .toString(); parseAndCreate( line1, controlLayout1 ); QHBoxLayout *controlLayout2 = new QHBoxLayout; controlLayout2->setSpacing( 0 ); controlLayout2->setMargin( 0 ); QString line2 = getSettings()->value( "MainWindow/MainToolbar2", MAIN_TB2_DEFAULT ) .toString(); parseAndCreate( line2, controlLayout2 ); grip = new QSizeGrip( this ); controlLayout2->addWidget( grip, 0, Qt::AlignBottom|Qt::AlignRight ); if( !b_advancedVisible && advControls ) advControls->hide(); controlLayout->addLayout( controlLayout1 ); controlLayout->addLayout( controlLayout2 ); }
/* * The special controller with drag'n drop abilities. * We don't do this in the main controller, since we don't want the OverHead * to propagate there too */ DroppingController::DroppingController( intf_thread_t *_p_intf, const QString& line, QWidget *_parent ) : AbstractController( _p_intf, _parent ) { rubberband = NULL; b_draging = false; setAcceptDrops( true ); controlLayout = new QHBoxLayout( this ); controlLayout->setSpacing( 5 ); controlLayout->setMargin( 0 ); setFrameShape( QFrame::StyledPanel ); setFrameShadow( QFrame::Raised ); parseAndCreate( line, controlLayout ); }
/********************************************************************** * Fullscrenn control widget **********************************************************************/ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWidget *_parent ) : AbstractController( _p_i, _parent ) { RTL_UNAFFECTED_WIDGET i_mouse_last_x = -1; i_mouse_last_y = -1; b_mouse_over = false; i_mouse_last_move_x = -1; i_mouse_last_move_y = -1; #if HAVE_TRANSPARENCY b_slow_hide_begin = false; i_slow_hide_timeout = 1; #endif b_fullscreen = false; i_hide_timeout = 1; i_screennumber = -1; vout.clear(); setWindowFlags( Qt::ToolTip ); setMinimumWidth( FSC_WIDTH ); isWideFSC = false; setFrameShape( QFrame::StyledPanel ); setFrameStyle( QFrame::Sunken ); setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); QVBoxLayout *controlLayout2 = new QVBoxLayout( this ); controlLayout2->setContentsMargins( 4, 6, 4, 2 ); /* First line */ InputControlsWidget *inputC = new InputControlsWidget( p_intf, this ); controlLayout2->addWidget( inputC ); controlLayout = new QHBoxLayout; QString line = getSettings()->value( "MainWindow/FSCtoolbar", FSC_TB_DEFAULT ).toString(); parseAndCreate( line, controlLayout ); controlLayout2->addLayout( controlLayout ); /* hiding timer */ p_hideTimer = new QTimer( this ); p_hideTimer->setSingleShot( true ); CONNECT( p_hideTimer, timeout(), this, hideFSC() ); /* slow hiding timer */ #if HAVE_TRANSPARENCY p_slowHideTimer = new QTimer( this ); CONNECT( p_slowHideTimer, timeout(), this, slowHideFSC() ); f_opacity = var_InheritFloat( p_intf, "qt-fs-opacity" ); #endif i_sensitivity = var_InheritInteger( p_intf, "qt-fs-sensitivity" ); vlc_mutex_init_recursive( &lock ); DCONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ), this, setVoutList( vout_thread_t **, int ) ); /* First Move */ previousPosition = getSettings()->value( "FullScreen/pos" ).toPoint(); screenRes = getSettings()->value( "FullScreen/screen" ).toRect(); isWideFSC = getSettings()->value( "FullScreen/wide" ).toBool(); i_screennumber = var_InheritInteger( p_intf, "qt-fullscreen-screennumber" ); CONNECT( this, fullscreenChanged( bool ), THEMIM, changeFullscreen( bool ) ); }