Commit 71219c5d authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Qt4 - add a button to scroll to currentItem. Close #1443

parent 0320a30e
......@@ -72,7 +72,7 @@ protected:
friend class PlaylistWidget;
private:
QTreeView *view;
QPushButton *repeatButton , *randomButton,*addButton;
QPushButton *repeatButton, *randomButton, *addButton, *gotoPlayingButton;
ClickLineEdit *searchLine;
int currentRootId;
QSignalMapper *ContextUpdateMapper;
......@@ -84,6 +84,7 @@ private slots:
void handleExpansion( const QModelIndex& );
void toggleRandom();
void toggleRepeat();
void gotoPlayingItem();
void doPopup( QModelIndex index, QPoint point );
void search( QString search );
void clearFilter();
......
......@@ -133,6 +133,11 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
BUTTONACT( repeatButton, toggleRepeat() );
buttons->addWidget( repeatButton );
/* Goto */
gotoPlayingButton = new QPushButton( qtr( "X" ), this );
BUTTONACT( gotoPlayingButton, gotoPlayingItem() );
buttons->addWidget( gotoPlayingButton );
/* A Spacer and the search possibilities */
QSpacerItem *spacer = new QSpacerItem( 10, 20 );
buttons->addItem( spacer );
......@@ -193,6 +198,11 @@ void StandardPLPanel::toggleRandom()
randomButton->setToolTip( prev ? qtr( I_PL_NORANDOM ) : qtr(I_PL_RANDOM ) );
}
void StandardPLPanel::gotoPlayingItem()
{
view->scrollTo( view->currentIndex() );
}
void StandardPLPanel::handleExpansion( const QModelIndex &index )
{
if( model->isCurrent( index ) )
......
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