Skip to content
Permalink
Browse files

Show category/range label as breadcrumb title when editing classes in…

… layer style dock
  • Loading branch information
nyalldawson committed Jan 16, 2019
1 parent 2aab283 commit 2e9919e150ea400ccf4c42757dbb0a37813ed461
@@ -720,6 +720,7 @@ void QgsCategorizedSymbolRendererWidget::changeCategorySymbol()
{
QgsSymbolSelectorWidget *dlg = new QgsSymbolSelectorWidget( symbol.release(), mStyle, mLayer, panel );
dlg->setContext( mContext );
dlg->setPanelTitle( category.label() );
connect( dlg, &QgsPanelWidget::widgetChanged, this, &QgsCategorizedSymbolRendererWidget::updateSymbolsFromWidget );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsCategorizedSymbolRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
@@ -1116,14 +1116,16 @@ void QgsGraduatedSymbolRendererWidget::changeSelectedSymbols()

void QgsGraduatedSymbolRendererWidget::changeRangeSymbol( int rangeIdx )
{
std::unique_ptr< QgsSymbol > newSymbol( mRenderer->ranges()[rangeIdx].symbol()->clone() );
const QgsRendererRange &range = mRenderer->ranges()[rangeIdx];
std::unique_ptr< QgsSymbol > newSymbol( range.symbol()->clone() );
QgsPanelWidget *panel = QgsPanelWidget::findParentPanel( this );
if ( panel && panel->dockMode() )
{
// bit tricky here - the widget doesn't take ownership of the symbol. So we need it to last for the duration of the
// panel's existence. Accordingly, just kinda give it ownership here, and clean up in cleanUpSymbolSelector
QgsSymbolSelectorWidget *dlg = new QgsSymbolSelectorWidget( newSymbol.release(), mStyle, mLayer, panel );
dlg->setContext( mContext );
dlg->setPanelTitle( range.label() );
connect( dlg, &QgsPanelWidget::widgetChanged, this, &QgsGraduatedSymbolRendererWidget::updateSymbolsFromWidget );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsGraduatedSymbolRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );

0 comments on commit 2e9919e

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