Commit 77b8c78a authored by Clément Stenac's avatar Clément Stenac

Layout improvements

parent 04b82589
...@@ -45,8 +45,6 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), ...@@ -45,8 +45,6 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ),
p_intf->p_sys->p_video = this; p_intf->p_sys->p_video = this;
p_vout = NULL; p_vout = NULL;
setFrameStyle(QFrame::Panel | QFrame::Raised);
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
connect( DialogsProvider::getInstance(NULL)->fixed_timer, connect( DialogsProvider::getInstance(NULL)->fixed_timer,
...@@ -152,8 +150,6 @@ void VideoWidget::Release( void *p_win ) ...@@ -152,8 +150,6 @@ void VideoWidget::Release( void *p_win )
updateGeometry(); 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" ) ) if( !config_GetInt( p_intf, "qt-always-video" ) )
need_update = true; need_update = true;
......
...@@ -30,8 +30,12 @@ ...@@ -30,8 +30,12 @@
#include <QCloseEvent> #include <QCloseEvent>
#include <assert.h> #include <assert.h>
#include <QPushButton> #include <QPushButton>
#include <QStatusBar>
#include "menus.hpp" #include "menus.hpp"
#define PREF_W 480
#define PREF_H 125
static int InteractCallback( vlc_object_t *, const char *, vlc_value_t, static int InteractCallback( vlc_object_t *, const char *, vlc_value_t,
vlc_value_t, void *); vlc_value_t, void *);
...@@ -43,10 +47,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -43,10 +47,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
setWindowTitle( QString::fromUtf8( _("VLC media player") ) ); setWindowTitle( QString::fromUtf8( _("VLC media player") ) );
ui.setupUi( centralWidget() ); ui.setupUi( centralWidget() );
slider = new InputSlider( Qt::Horizontal, ui.sliderBox ); slider = new InputSlider( Qt::Horizontal, NULL );
QVBoxLayout *box_layout = new QVBoxLayout(); ui.hboxLayout->insertWidget( 0, slider );
box_layout->addWidget( slider );
ui.sliderBox->setLayout( box_layout );
ui.prevButton->setText( "" ); ui.prevButton->setText( "" );
ui.nextButton->setText( "" ); ui.nextButton->setText( "" );
ui.playButton->setText( "" ); ui.playButton->setText( "" );
...@@ -60,7 +62,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -60,7 +62,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
QVLCMenu::createMenuBar( menuBar(), 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" ) ) // if( config_GetInt( p_intf, "embedded" ) )
{ {
...@@ -80,20 +87,20 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -80,20 +87,20 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
fprintf( stderr, "Margin : %i\n",ui.vboxLayout->margin() ); fprintf( stderr, "Margin : %i\n",ui.vboxLayout->margin() );
readSettings( "MainWindow" ); 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" ) ) if( config_GetInt( p_intf, "qt-always-video" ) )
mainSize = videoSize + addSize; mainSize = videoSize + addSize;
else else
mainSize = QSize( 500,131 ); mainSize = QSize( PREF_W, PREF_H );
resize( 500,131 );
resize( mainSize ); resize( mainSize );
mainSize = size(); mainSize = size();
fprintf( stderr, "Size is %ix%i - Video %ix%i\n", mainSize.width(), mainSize.height(), videoSize.width(), videoSize.height() ); 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() ); fprintf( stderr, "Additional size around video %ix%i", addSize.width(), addSize.height() );
setMinimumSize( 500, addSize.height() ); setMinimumSize( PREF_W, addSize.height() );
/* Init input manager */ /* Init input manager */
MainInputManager::getInstance( p_intf ); MainInputManager::getInstance( p_intf );
...@@ -107,6 +114,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -107,6 +114,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
slider, SLOT( setPosition( float,int, int ) ) ); slider, SLOT( setPosition( float,int, int ) ) );
connect( THEMIM->getIM(), SIGNAL( positionUpdated( float, int, int ) ), connect( THEMIM->getIM(), SIGNAL( positionUpdated( float, int, int ) ),
this, SLOT( setDisplay( 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 ) ), connect( THEMIM->getIM(), SIGNAL( statusChanged( int ) ),
this, SLOT( setStatus( int ) ) ); this, SLOT( setStatus( int ) ) );
connect( slider, SIGNAL( sliderDragged( float ) ), connect( slider, SIGNAL( sliderDragged( float ) ),
...@@ -178,7 +187,12 @@ void MainInterface::setDisplay( float pos, int time, int length ) ...@@ -178,7 +187,12 @@ void MainInterface::setDisplay( float pos, int time, int length )
secstotimestr( psz_time, time ); secstotimestr( psz_time, time );
QString title; QString title;
title.sprintf( "%s/%s", psz_time, psz_length ); 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 ) void MainInterface::setStatus( int status )
......
...@@ -48,12 +48,15 @@ protected: ...@@ -48,12 +48,15 @@ protected:
private: private:
VideoWidget *videoWidget; VideoWidget *videoWidget;
InputManager *main_input_manager; InputManager *main_input_manager;
QLabel *timeLabel;
QLabel *nameLabel;
InputSlider *slider; InputSlider *slider;
/// Main input associated to the playlist /// Main input associated to the playlist
input_thread_t *p_input; input_thread_t *p_input;
Ui::MainInterfaceUI ui; Ui::MainInterfaceUI ui;
private slots: private slots:
void setStatus( int ); void setStatus( int );
void setName( QString );
void setDisplay( float, int, int ); void setDisplay( float, int, int );
void updateOnTimer(); void updateOnTimer();
void play(); void play();
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<exportmacro></exportmacro> <exportmacro></exportmacro>
<class>MainInterfaceUI</class> <class>MainInterfaceUI</class>
<widget class="QWidget" name="MainInterfaceUI" > <widget class="QWidget" name="MainInterfaceUI" >
<!-- <property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>444</width> <width>426</width>
<height>80</height> <height>73</height>
</rect> </rect>
</property> --> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy>
<hsizetype>0</hsizetype> <hsizetype>0</hsizetype>
...@@ -39,19 +39,7 @@ ...@@ -39,19 +39,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="sliderBox" > <widget class="QFrame" name="sliderFrame" />
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>0:00:00/0:00:00</string>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QFrame" name="discFrame" > <widget class="QFrame" name="discFrame" >
...@@ -63,12 +51,6 @@ ...@@ -63,12 +51,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
...@@ -91,10 +73,16 @@ ...@@ -91,10 +73,16 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="maximumSize" >
<size>
<width>35</width>
<height>26</height>
</size>
</property>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
<width>24</width> <width>20</width>
<height>24</height> <height>20</height>
</size> </size>
</property> </property>
</widget> </widget>
...@@ -109,13 +97,19 @@ ...@@ -109,13 +97,19 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="maximumSize" >
<size>
<width>35</width>
<height>26</height>
</size>
</property>
<property name="text" > <property name="text" >
<string/> <string/>
</property> </property>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
<width>24</width> <width>20</width>
<height>24</height> <height>20</height>
</size> </size>
</property> </property>
</widget> </widget>
...@@ -130,13 +124,19 @@ ...@@ -130,13 +124,19 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="maximumSize" >
<size>
<width>35</width>
<height>26</height>
</size>
</property>
<property name="text" > <property name="text" >
<string/> <string/>
</property> </property>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
<width>24</width> <width>20</width>
<height>24</height> <height>20</height>
</size> </size>
</property> </property>
</widget> </widget>
...@@ -151,13 +151,19 @@ ...@@ -151,13 +151,19 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="maximumSize" >
<size>
<width>35</width>
<height>26</height>
</size>
</property>
<property name="text" > <property name="text" >
<string/> <string/>
</property> </property>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
<width>24</width> <width>20</width>
<height>24</height> <height>20</height>
</size> </size>
</property> </property>
</widget> </widget>
...@@ -184,6 +190,20 @@ ...@@ -184,6 +190,20 @@
</item> </item>
<item> <item>
<widget class="QSlider" name="volumeSlider" > <widget class="QSlider" name="volumeSlider" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment