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

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

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