Commit 8d3b932e authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: playlist: pad zoom slider (fixes #5291)

parent ea17bdc3
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include <QMenu> #include <QMenu>
#include <QSignalMapper> #include <QSignalMapper>
#include <QSlider> #include <QSlider>
#include <QSpacerItem>
#include <QList>
/********************************************************************** /**********************************************************************
* Playlist Widget. The embedded playlist * Playlist Widget. The embedded playlist
...@@ -187,7 +189,16 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -187,7 +189,16 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
zoomSlider->setValue( model->getZoom() ); zoomSlider->setValue( model->getZoom() );
CONNECT( zoomSlider, valueChanged( int ), model, changeZoom( int ) ); CONNECT( zoomSlider, valueChanged( int ), model, changeZoom( int ) );
layout->addWidget( zoomSlider, 1, 3, ( Qt::AlignBottom | Qt::AlignRight ) ); /* pad our zoom slider */
QGridLayout *sliderLayout = new QGridLayout( this );
QSpacerItem* sliderSpacer =
new QSpacerItem( mainView->getScrollBarsSize(),
mainView->getScrollBarsSize(),
QSizePolicy::Fixed, QSizePolicy::Fixed );
sliderLayout->addWidget( zoomSlider, 0, 0, Qt::AlignCenter );
sliderLayout->addItem( sliderSpacer, 1, 1, Qt::AlignCenter );
layout->addLayout( sliderLayout, 1, 3, ( Qt::AlignBottom | Qt::AlignRight ) );
setAcceptDrops( true ); setAcceptDrops( true );
setWindowTitle( qtr( "Playlist" ) ); setWindowTitle( qtr( "Playlist" ) );
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <QStackedLayout> #include <QStackedLayout>
#include <QSignalMapper> #include <QSignalMapper>
#include <QSettings> #include <QSettings>
#include <QScrollBar>
#include <assert.h> #include <assert.h>
...@@ -411,6 +412,12 @@ int StandardPLPanel::currentViewIndex() const ...@@ -411,6 +412,12 @@ int StandardPLPanel::currentViewIndex() const
return PICTUREFLOW_VIEW; return PICTUREFLOW_VIEW;
} }
int StandardPLPanel::getScrollBarsSize() const
{
/* FIXME: should return a set in case of different widths */
return currentView->verticalScrollBar()->sizeHint().width();
}
void StandardPLPanel::cycleViews() void StandardPLPanel::cycleViews()
{ {
if( currentView == iconView ) if( currentView == iconView )
......
...@@ -69,6 +69,7 @@ public: ...@@ -69,6 +69,7 @@ public:
VIEW_COUNT }; VIEW_COUNT };
int currentViewIndex() const; int currentViewIndex() const;
int getScrollBarsSize() const;
protected: protected:
PLModel *model; PLModel *model;
......
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