Commit e579cbf3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

EffectStack: When reordering, update the selected index.

parent 6c45a6e1
......@@ -56,10 +56,14 @@ void
EffectStack::moveUp()
{
m_model->moveUp( m_ui->list->currentIndex() );
if ( m_ui->list->currentIndex().row() > 0 )
m_ui->list->setCurrentIndex( m_ui->list->currentIndex().sibling( m_ui->list->currentIndex().row() - 1, 0 ) );
}
void
EffectStack::moveDown()
{
m_model->moveDown( m_ui->list->currentIndex() );
if ( m_ui->list->currentIndex().row() < m_model->rowCount( QModelIndex() ) - 1 )
m_ui->list->setCurrentIndex( m_ui->list->currentIndex().sibling( m_ui->list->currentIndex().row() + 1, 0 ) );
}
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