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
  • Loading branch information
nyalldawson committed Sep 23, 2016
1 parent 4dbea7f commit f67a48a39ba93f57597f6c7cc021e78460091200
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" ) );

1 comment on commit f67a48a

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn commented on f67a48a Sep 23, 2016

@nyalldawson , ah, I was victim of that quite a few times, thanks.

Also, what IMHO would help here is for the effect settings panel to switch to an effect that's just been activated via its checkbox. I've had countless "args" when realizing that I was changing the settings of a different effect when activating [x] drop shadow checkbox.

Please sign in to comment.