Skip to content

Commit

Permalink
Show category/range label as breadcrumb title when editing classes in…
Browse files Browse the repository at this point in the history
… layer style dock
  • Loading branch information
nyalldawson committed Jan 16, 2019
1 parent 2aab283 commit 2e9919e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 3 additions & 1 deletion src/gui/symbology/qgsgraduatedsymbolrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 2e9919e

Please sign in to comment.