Skip to content
Permalink
Browse files

Set initial effect selection in layer effects widget to

first enabled effect

Hopefully makes the widget a bit more user friendly - otherwise
the initial settings shown may be for a disabled effect and the
users is left wondering why changes have no impact

(cherry-picked from f67a48a)
  • Loading branch information
nyalldawson committed Sep 26, 2016
1 parent 2f37872 commit 2ae875f0400924e46e8aacf8a2c0cb08497eecfe
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/gui/effects/qgseffectstackpropertieswidget.cpp
@@ -130,8 +130,18 @@ QgsEffectStackPropertiesWidget::QgsEffectStackPropertiesWidget( QgsEffectStack *

updateUi();

// set effect as active item in the tree
QModelIndex newIndex = mEffectsList->model()->index( 0, 0 );
// set first selected effect as active item in the tree
int initialRow = 0;
for ( int i = 0; i < stack->count(); ++i )
{
// list shows effects in opposite order to stack
if ( stack->effect( stack->count() - i - 1 )->enabled() )
{
initialRow = i;
break;
}
}
QModelIndex newIndex = mEffectsList->model()->index( initialRow, 0 );
mEffectsList->setCurrentIndex( newIndex );

setPanelTitle( tr( "Effects Properties" ) );

0 comments on commit 2ae875f

Please sign in to comment.
You can’t perform that action at this time.