Commit 8d3b932e authored by François Cartegnie's avatar François Cartegnie 🤞

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

parent ea17bdc3
......@@ -41,6 +41,8 @@
#include <QMenu>
#include <QSignalMapper>
#include <QSlider>
#include <QSpacerItem>
#include <QList>
/**********************************************************************
* Playlist Widget. The embedded playlist
......@@ -187,7 +189,16 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
zoomSlider->setValue( model->getZoom() );
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 );
setWindowTitle( qtr( "Playlist" ) );
......
......@@ -48,6 +48,7 @@
#include <QStackedLayout>
#include <QSignalMapper>
#include <QSettings>
#include <QScrollBar>
#include <assert.h>
......@@ -411,6 +412,12 @@ int StandardPLPanel::currentViewIndex() const
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()
{
if( currentView == iconView )
......
......@@ -69,6 +69,7 @@ public:
VIEW_COUNT };
int currentViewIndex() const;
int getScrollBarsSize() const;
protected:
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