[vlc-devel] [PATCH 2/4] qt: Remove macOS specific playlist splitter

Marvin Scholz epirat07 at gmail.com
Sun Nov 26 05:42:30 CET 2017


This makes the splitter look a little bit weird on macOS, but removes a
lot of code.
---
 modules/gui/qt/components/playlist/playlist.cpp | 25 +-----------------------
 modules/gui/qt/components/playlist/playlist.hpp | 26 -------------------------
 2 files changed, 1 insertion(+), 50 deletions(-)

diff --git a/modules/gui/qt/components/playlist/playlist.cpp b/modules/gui/qt/components/playlist/playlist.cpp
index 992477b552..d1f7d5543e 100644
--- a/modules/gui/qt/components/playlist/playlist.cpp
+++ b/modules/gui/qt/components/playlist/playlist.cpp
@@ -138,7 +138,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
     CONNECT( selector, SDCategorySelected(bool), mainView, setWaiting(bool) );
 
     /* */
-    split = new PlaylistSplitter( this );
+    split = new QSplitter( this );
 
     /* Add the two sides of the QSplitter */
     split->addWidget( leftSplitter );
@@ -413,26 +413,3 @@ QSize LocationButton::sizeHint() const
 }
 
 #undef PADDING
-
-#ifdef Q_OS_MAC
-QSplitterHandle *PlaylistSplitter::createHandle()
-{
-    return new SplitterHandle( orientation(), this );
-}
-
-SplitterHandle::SplitterHandle( Qt::Orientation orientation, QSplitter * parent )
-               : QSplitterHandle( orientation, parent)
-{
-};
-
-QSize SplitterHandle::sizeHint() const
-{
-    return (orientation() == Qt::Horizontal) ? QSize( 1, height() ) : QSize( width(), 1 );
-}
-
-void SplitterHandle::paintEvent(QPaintEvent *event)
-{
-    QPainter painter( this );
-    painter.fillRect( event->rect(), QColor(81, 81, 81) );
-}
-#endif /* __APPLE__ */
diff --git a/modules/gui/qt/components/playlist/playlist.hpp b/modules/gui/qt/components/playlist/playlist.hpp
index 1955370d22..64e7cc112b 100644
--- a/modules/gui/qt/components/playlist/playlist.hpp
+++ b/modules/gui/qt/components/playlist/playlist.hpp
@@ -82,32 +82,6 @@ private slots:
     friend class PlaylistDialog;
 };
 
-#ifdef Q_OS_MAC
-class PlaylistSplitter : public QSplitter
-{
-public:
-    PlaylistSplitter( QWidget *_parent ) : QSplitter( _parent ){}
-protected:
-    virtual QSplitterHandle *createHandle();
-};
-#else
- #define PlaylistSplitter QSplitter
-#endif
-
-#ifdef Q_OS_MAC
-class SplitterHandle : public QSplitterHandle
-{
-public:
-    SplitterHandle( Qt::Orientation orientation, QSplitter * parent );
-
-protected:
-    void paintEvent ( QPaintEvent * ) Q_DECL_OVERRIDE;
-
-private:
-    QSize sizeHint () const Q_DECL_OVERRIDE;
-};
-#endif /* __APPLE__ */
-
 class LocationButton : public QPushButton
 {
 public:
-- 
2.13.6 (Apple Git-96)



More information about the vlc-devel mailing list