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 ),
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;
......
......@@ -30,8 +30,12 @@
#include <QCloseEvent>
#include <assert.h>
#include <QPushButton>
#include <QStatusBar>
#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 )
......
......@@ -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();
......
......@@ -4,14 +4,14 @@
<exportmacro></exportmacro>
<class>MainInterfaceUI</class>
<widget class="QWidget" name="MainInterfaceUI" >
<!-- <property name="geometry" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>444</width>
<height>80</height>
<width>426</width>
<height>73</height>
</rect>
</property> -->
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
......@@ -39,19 +39,7 @@
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="sliderBox" >
<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>
<widget class="QFrame" name="sliderFrame" />
</item>
<item>
<widget class="QFrame" name="discFrame" >
......@@ -63,12 +51,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
......@@ -91,10 +73,16 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>35</width>
<height>26</height>
</size>
</property>
<property name="iconSize" >
<size>
<width>24</width>
<height>24</height>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
......@@ -109,13 +97,19 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>35</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>24</width>
<height>24</height>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
......@@ -130,13 +124,19 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>35</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>24</width>
<height>24</height>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
......@@ -151,13 +151,19 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>35</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>24</width>
<height>24</height>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
......@@ -184,6 +190,20 @@
</item>
<item>
<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" >
<enum>Qt::Horizontal</enum>
</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