#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 *);
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( "" );
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" ) )
{
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 );
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 ) ),
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 )
<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>
<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" >
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="frameShape" >
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Raised</enum>
- </property>
</widget>
</item>
</layout>
<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>
<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>
<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>
<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>
</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>