[vlc-devel] commit: Qt: EPG, add a close button and other GUI improvements ( Jean-Baptiste Kempf )

git version control git at videolan.org
Thu Jan 28 01:38:48 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jan 27 16:28:06 2010 +0100| [91b3352a7f52e985ebb4172f6a6c1c89c6a8769a] | committer: Jean-Baptiste Kempf 

Qt: EPG, add a close button and other GUI improvements

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=91b3352a7f52e985ebb4172f6a6c1c89c6a8769a
---

 modules/gui/qt4/dialogs/epg.cpp |   23 ++++++++++++++++++-----
 modules/gui/qt4/dialogs/epg.hpp |    1 +
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index 16db0e8..85222fb 100644
--- a/modules/gui/qt4/dialogs/epg.cpp
+++ b/modules/gui/qt4/dialogs/epg.cpp
@@ -28,16 +28,18 @@
 
 #include "components/epg/EPGWidget.hpp"
 
-#include <QHBoxLayout>
+#include <QVBoxLayout>
 #include <QSplitter>
 #include <QLabel>
 #include <QGroupBox>
+#include <QPushButton>
 
 EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
 {
     setWindowTitle( "Program Guide" );
 
-    QHBoxLayout *layout = new QHBoxLayout( this );
+    QVBoxLayout *layout = new QVBoxLayout( this );
+    layout->setMargin( 0 );
     QSplitter *splitter = new QSplitter( this );
     EPGWidget *epg = new EPGWidget( this );
     splitter->addWidget( epg );
@@ -45,7 +47,7 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
 
     QGroupBox *descBox = new QGroupBox( qtr( "Description" ), this );
 
-    QHBoxLayout *boxLayout = new QHBoxLayout( descBox );
+    QVBoxLayout *boxLayout = new QVBoxLayout( descBox );
 
     description = new QLabel( this );
     description->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel );
@@ -55,13 +57,22 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
     palette.setBrush(QPalette::Active, QPalette::Window, palette.brush( QPalette::Base ) );
     description->setPalette( palette );
 
-    boxLayout->addWidget( description );
+    title = new QLabel( qtr( "Title" ), this );
+
+    boxLayout->addWidget( title );
+    boxLayout->addWidget( description, 10 );
 
     splitter->addWidget( epg );
     splitter->addWidget( descBox );
     layout->addWidget( splitter );
 
-    CONNECT( epg, descriptionChanged( EPGEvent *), this, showEvent( EPGEvent *) );
+    CONNECT( epg, itemSelectionChanged( EPGEvent *), this, showEvent( EPGEvent *) );
+
+    QPushButton *close = new QPushButton( qtr( "&Close" ) );
+    layout->addWidget( close, 0, Qt::AlignRight );
+    BUTTONACT( close, close() );
+
+    resize( 650, 400 );
 }
 
 EpgDialog::~EpgDialog()
@@ -72,5 +83,7 @@ void EpgDialog::showEvent( EPGEvent *event )
 {
     if( !event ) return;
 
+    title->setText( event->name );
     description->setText( event->description );
 }
+
diff --git a/modules/gui/qt4/dialogs/epg.hpp b/modules/gui/qt4/dialogs/epg.hpp
index a1159e3..80ebb95 100644
--- a/modules/gui/qt4/dialogs/epg.hpp
+++ b/modules/gui/qt4/dialogs/epg.hpp
@@ -37,6 +37,7 @@ private:
     virtual ~EpgDialog();
 
     QLabel *description;
+    QLabel *title;
 
     friend class    Singleton<EpgDialog>;
 




More information about the vlc-devel mailing list