[vlc-commits] commit: Qt: reinstate the small QSplitter on Mac for the playlist ( Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Fri Dec 10 16:19:11 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Dec 10 16:17:44 2010 +0100| [501530e61e474423b0761e8b8b6a5b62c8da5bc4] | committer: Jean-Baptiste Kempf 

Qt: reinstate the small QSplitter on Mac for the playlist

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

 modules/gui/qt4/components/playlist/playlist.cpp |    6 +++---
 modules/gui/qt4/components/playlist/playlist.hpp |   16 ++++++++++++----
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index 3f12dd1..00e34e7 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -147,7 +147,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
               mainView, setRoot( playlist_item_t * ) );
 
 
-    split = new QSplitter(this);
+    split = new PlaylistSplitter( this );
 
     /* Add the two sides of the QSplitter */
     split->addWidget( leftSplitter );
@@ -421,9 +421,9 @@ QSize LocationButton::sizeHint() const
 #undef PADDING
 
 #ifdef Q_WS_MAC
-QSplitterHandle *PlaylistWidget::createHandle()
+QSplitterHandle *PlaylistSplitter::createHandle()
 {
-    return new SplitterHandle( split->orientation(), split );
+    return new SplitterHandle( orientation(), this );
 }
 
 SplitterHandle::SplitterHandle( Qt::Orientation orientation, QSplitter * parent )
diff --git a/modules/gui/qt4/components/playlist/playlist.hpp b/modules/gui/qt4/components/playlist/playlist.hpp
index 3c105c5..bfac66b 100644
--- a/modules/gui/qt4/components/playlist/playlist.hpp
+++ b/modules/gui/qt4/components/playlist/playlist.hpp
@@ -72,15 +72,23 @@ protected:
     virtual void dropEvent( QDropEvent *);
     virtual void dragEnterEvent( QDragEnterEvent * );
     virtual void closeEvent( QCloseEvent * );
-#ifdef __APPLE__
-    virtual QSplitterHandle *createHandle();
-#endif
-
 private slots:
     void changeView( const QModelIndex& index );
 };
 
 #ifdef Q_WS_MAC
+class PlaylistSplitter : public QSplitter
+{
+public:
+    PlaylistSplitter( QWidget *_parent ) : QSplitter( _parent ){}
+protected:
+    virtual QSplitterHandle *createHandle();
+};
+#else
+ #define PlaylistSplitter QSplitter
+#endif
+
+#ifdef Q_WS_MAC
 class SplitterHandle : public QSplitterHandle
 {
 public:



More information about the vlc-commits mailing list