]> git.sesse.net Git - vlc/commitdiff
Layout improvements
authorClément Stenac <zorglub@videolan.org>
Tue, 18 Jul 2006 21:29:05 +0000 (21:29 +0000)
committerClément Stenac <zorglub@videolan.org>
Tue, 18 Jul 2006 21:29:05 +0000 (21:29 +0000)
modules/gui/qt4/components/video_widget.cpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/ui/main_interface.ui

index 964885af88e6c2e3015166befd18693f5ac01572..7235f215d9edd344f06db7e16cc3f86bc3b536fa 100644 (file)
@@ -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;
 
index 6fb76d1efdab02c58d206f9682fd06514f6c70a4..763cc2dea60e9a22946f9dc8b8dc6255d9af6917 100644 (file)
 #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 )
index 92aa83f16a7c8a5cee0582fe46a620846c9cae1f..d06e34f76f54deea2cfc119df3ecefbf4264d8be 100644 (file)
@@ -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();
index e4145c4bad73fdde540fdfef7720231d30be0f7f..ba28fbdabc27e3c54fb129b84fe76e1df4ce3919 100644 (file)
@@ -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>
       <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>