From: Clément Stenac Date: Tue, 18 Jul 2006 21:29:05 +0000 (+0000) Subject: Layout improvements X-Git-Tag: 0.9.0-test0~10830 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=77b8c78a77756ae7b5ff80d96f9ab392eb8c98b2;p=vlc Layout improvements --- diff --git a/modules/gui/qt4/components/video_widget.cpp b/modules/gui/qt4/components/video_widget.cpp index 964885af88..7235f215d9 100644 --- a/modules/gui/qt4/components/video_widget.cpp +++ b/modules/gui/qt4/components/video_widget.cpp @@ -45,8 +45,6 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf->p_sys->p_video = this; p_vout = NULL; - setFrameStyle(QFrame::Panel | QFrame::Raised); - setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); connect( DialogsProvider::getInstance(NULL)->fixed_timer, @@ -152,8 +150,6 @@ void VideoWidget::Release( void *p_win ) updateGeometry(); -// p_intf->p_sys->p_mi->setMinimumSize( 500, -// p_intf->p_sys->p_mi->addSize.height() ); if( !config_GetInt( p_intf, "qt-always-video" ) ) need_update = true; diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index 6fb76d1efd..763cc2dea6 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -30,8 +30,12 @@ #include #include #include +#include #include "menus.hpp" +#define PREF_W 480 +#define PREF_H 125 + static int InteractCallback( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void *); @@ -43,10 +47,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) setWindowTitle( QString::fromUtf8( _("VLC media player") ) ); ui.setupUi( centralWidget() ); - slider = new InputSlider( Qt::Horizontal, ui.sliderBox ); - QVBoxLayout *box_layout = new QVBoxLayout(); - box_layout->addWidget( slider ); - ui.sliderBox->setLayout( box_layout ); + slider = new InputSlider( Qt::Horizontal, NULL ); + ui.hboxLayout->insertWidget( 0, slider ); ui.prevButton->setText( "" ); ui.nextButton->setText( "" ); ui.playButton->setText( "" ); @@ -60,7 +62,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) QVLCMenu::createMenuBar( menuBar(), p_intf ); - resize (500, 131 ); + timeLabel = new QLabel( this ); + nameLabel = new QLabel( this ); + statusBar()->addWidget( nameLabel, 4 ); + statusBar()->addPermanentWidget( timeLabel, 1 ); + + resize ( PREF_W, PREF_H ); // if( config_GetInt( p_intf, "embedded" ) ) { @@ -80,20 +87,20 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) fprintf( stderr, "Margin : %i\n",ui.vboxLayout->margin() ); readSettings( "MainWindow" ); - addSize = QSize( ui.vboxLayout->margin() * 2, 131 ); + addSize = QSize( ui.vboxLayout->margin() * 2, PREF_H ); if( config_GetInt( p_intf, "qt-always-video" ) ) mainSize = videoSize + addSize; else - mainSize = QSize( 500,131 ); - resize( 500,131 ); + mainSize = QSize( PREF_W, PREF_H ); + resize( mainSize ); mainSize = size(); fprintf( stderr, "Size is %ix%i - Video %ix%i\n", mainSize.width(), mainSize.height(), videoSize.width(), videoSize.height() ); fprintf( stderr, "Additional size around video %ix%i", addSize.width(), addSize.height() ); - setMinimumSize( 500, addSize.height() ); + setMinimumSize( PREF_W, addSize.height() ); /* Init input manager */ MainInputManager::getInstance( p_intf ); @@ -107,6 +114,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) slider, SLOT( setPosition( float,int, int ) ) ); connect( THEMIM->getIM(), SIGNAL( positionUpdated( float, int, int ) ), this, SLOT( setDisplay( float, int, int ) ) ); + connect( THEMIM->getIM(), SIGNAL( nameChanged( QString ) ), + this, SLOT( setName( QString ) ) ); connect( THEMIM->getIM(), SIGNAL( statusChanged( int ) ), this, SLOT( setStatus( int ) ) ); connect( slider, SIGNAL( sliderDragged( float ) ), @@ -178,7 +187,12 @@ void MainInterface::setDisplay( float pos, int time, int length ) secstotimestr( psz_time, time ); QString title; title.sprintf( "%s/%s", psz_time, psz_length ); - ui.sliderBox->setTitle( title ); + timeLabel->setText( title ); +} + +void MainInterface::setName( QString name ) +{ + nameLabel->setText( name ); } void MainInterface::setStatus( int status ) diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp index 92aa83f16a..d06e34f76f 100644 --- a/modules/gui/qt4/main_interface.hpp +++ b/modules/gui/qt4/main_interface.hpp @@ -48,12 +48,15 @@ protected: private: VideoWidget *videoWidget; InputManager *main_input_manager; + QLabel *timeLabel; + QLabel *nameLabel; InputSlider *slider; /// Main input associated to the playlist input_thread_t *p_input; Ui::MainInterfaceUI ui; private slots: void setStatus( int ); + void setName( QString ); void setDisplay( float, int, int ); void updateOnTimer(); void play(); diff --git a/modules/gui/qt4/ui/main_interface.ui b/modules/gui/qt4/ui/main_interface.ui index e4145c4bad..ba28fbdabc 100644 --- a/modules/gui/qt4/ui/main_interface.ui +++ b/modules/gui/qt4/ui/main_interface.ui @@ -4,14 +4,14 @@ MainInterfaceUI - + 0 @@ -39,19 +39,7 @@ 0 - - - - 5 - 0 - 0 - 0 - - - - 0:00:00/0:00:00 - - + @@ -63,12 +51,6 @@ 0 - - QFrame::StyledPanel - - - QFrame::Raised - @@ -91,10 +73,16 @@ 0 + + + 35 + 26 + + - 24 - 24 + 20 + 20 @@ -109,13 +97,19 @@ 0 + + + 35 + 26 + + - 24 - 24 + 20 + 20 @@ -130,13 +124,19 @@ 0 + + + 35 + 26 + + - 24 - 24 + 20 + 20 @@ -151,13 +151,19 @@ 0 + + + 35 + 26 + + - 24 - 24 + 20 + 20 @@ -184,6 +190,20 @@ + + + 0 + 0 + 0 + 0 + + + + + 80 + 16777215 + + Qt::Horizontal