[vlmc-devel] commit: EffectStack: When reordering, update the selected index. ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Tue Aug 31 00:12:16 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Aug 30 22:23:10 2010 +0200| [e579cbf3710528334474e86ad3906f6e8f6ca8f1] | committer: Hugo Beauzée-Luyssen
EffectStack: When reordering, update the selected index.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=e579cbf3710528334474e86ad3906f6e8f6ca8f1
---
src/Gui/effectsengine/EffectStack.cpp | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/Gui/effectsengine/EffectStack.cpp b/src/Gui/effectsengine/EffectStack.cpp
index 15c279b..3a06175 100644
--- a/src/Gui/effectsengine/EffectStack.cpp
+++ b/src/Gui/effectsengine/EffectStack.cpp
@@ -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 ) );
}
More information about the Vlmc-devel
mailing list