Commit 6627718c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: playlist, use a better QSplitter, on Mac

It might be a good idea to do the same on other platforms
parent f28ecfb0
...@@ -415,3 +415,26 @@ QSize LocationButton::sizeHint() const ...@@ -415,3 +415,26 @@ QSize LocationButton::sizeHint() const
} }
#undef PADDING #undef PADDING
#ifdef Q_WS_MAC
QSplitterHandle *PlaylistWidget::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(), QBrush(Qt::gray));
}
#endif /* __APPLE__ */
...@@ -35,7 +35,10 @@ ...@@ -35,7 +35,10 @@
//#include <vlc_playlist.h> //#include <vlc_playlist.h>
#include <QSplitter> #include <QSplitter>
#include <QPushButton> #include <QPushButton>
#include <QSPlitterHandle>
#include <QMouseEvent>
class StandardPLPanel; class StandardPLPanel;
class LocationBar; class LocationBar;
...@@ -68,11 +71,28 @@ protected: ...@@ -68,11 +71,28 @@ protected:
virtual void dropEvent( QDropEvent *); virtual void dropEvent( QDropEvent *);
virtual void dragEnterEvent( QDragEnterEvent * ); virtual void dragEnterEvent( QDragEnterEvent * );
virtual void closeEvent( QCloseEvent * ); virtual void closeEvent( QCloseEvent * );
#ifdef __APPLE__
virtual QSplitterHandle *createHandle();
#endif
private slots: private slots:
void changeView( const QModelIndex& index ); void changeView( const QModelIndex& index );
}; };
#ifdef Q_WS_MAC
class SplitterHandle : public QSplitterHandle
{
public:
SplitterHandle( Qt::Orientation orientation, QSplitter * parent );
protected:
virtual void paintEvent ( QPaintEvent * );
private:
virtual QSize sizeHint () const;
};
#endif /* __APPLE__ */
class LocationButton : public QPushButton class LocationButton : public QPushButton
{ {
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment