Skip to content

Commit

Permalink
When a panel widget opens a new panel, the new panel should inherit
Browse files Browse the repository at this point in the history
the dock mode of the previous panel
  • Loading branch information
nyalldawson committed Sep 14, 2016
1 parent c9f0901 commit 01ec0e4
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/gui/qgspanelwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ QgsPanelWidget*QgsPanelWidget::findParentPanel( QWidget* widget )

void QgsPanelWidget::openPanel( QgsPanelWidget* panel )
{
//panel dock mode inherits from this panel
panel->setDockMode( dockMode() );

if ( mDockMode )
{
emit showPanel( panel );
Expand Down
2 changes: 0 additions & 2 deletions src/gui/symbology-ng/qgscategorizedsymbolrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ void QgsCategorizedSymbolRendererWidget::changeCategorizedSymbol()
{
QgsSymbol* newSymbol = mCategorizedSymbol->clone();
QgsSymbolSelectorWidget* dlg = new QgsSymbolSelectorWidget( newSymbol, mStyle, mLayer, nullptr );
dlg->setDockMode( this->dockMode() );
dlg->setMapCanvas( mMapCanvas );

connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolsFromWidget() ) );
Expand Down Expand Up @@ -594,7 +593,6 @@ void QgsCategorizedSymbolRendererWidget::changeCategorySymbol()
}

QgsSymbolSelectorWidget* dlg = new QgsSymbolSelectorWidget( symbol, mStyle, mLayer, nullptr );
dlg->setDockMode( this->dockMode() );
dlg->setMapCanvas( mMapCanvas );
connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolsFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget* ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget* ) ) );
Expand Down
1 change: 0 additions & 1 deletion src/gui/symbology-ng/qgsgraduatedsymbolrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,6 @@ void QgsGraduatedSymbolRendererWidget::changeRangeSymbol( int rangeIdx )
{
QgsSymbol* newSymbol = mRenderer->ranges()[rangeIdx].symbol()->clone();
QgsSymbolSelectorWidget* dlg = new QgsSymbolSelectorWidget( newSymbol, mStyle, mLayer, nullptr );
dlg->setDockMode( this->dockMode() );
dlg->setMapCanvas( mMapCanvas );

connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolsFromWidget() ) );
Expand Down
2 changes: 0 additions & 2 deletions src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ void QgsPointDisplacementRendererWidget::on_mRendererSettingsButton_clicked()
QgsRendererWidget* w = m->createRendererWidget( mLayer, mStyle, mRenderer->embeddedRenderer()->clone() );
w->setMapCanvas( mMapCanvas );
connect( w, SIGNAL( widgetChanged() ), this, SLOT( updateRendererFromWidget() ) );
w->setDockMode( this->dockMode() );
openPanel( w );
}
}
Expand Down Expand Up @@ -351,7 +350,6 @@ void QgsPointDisplacementRendererWidget::on_mCenterSymbolPushButton_clicked()
}
QgsMarkerSymbol* markerSymbol = mRenderer->centerSymbol()->clone();
QgsSymbolSelectorWidget* dlg = new QgsSymbolSelectorWidget( markerSymbol, QgsStyle::defaultStyle(), mLayer, this );
dlg->setDockMode( this->dockMode() );
dlg->setMapCanvas( mMapCanvas );
connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateCenterSymbolFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget* ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget* ) ) );
Expand Down
2 changes: 0 additions & 2 deletions src/gui/symbology-ng/qgsrulebasedrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ void QgsRuleBasedRendererWidget::refineRuleCategoriesGui( const QModelIndexList&
QgsCategorizedSymbolRendererWidget* w = new QgsCategorizedSymbolRendererWidget( mLayer, mStyle, nullptr );
w->setPanelTitle( tr( "Add categories to rules" ) );
connect( w, SIGNAL( panelAccepted( QgsPanelWidget* ) ), this, SLOT( refineRuleCategoriesAccepted( QgsPanelWidget* ) ) );
w->setDockMode( this->dockMode() );
w->setMapCanvas( mMapCanvas );
openPanel( w );
}
Expand All @@ -271,7 +270,6 @@ void QgsRuleBasedRendererWidget::refineRuleRangesGui( const QModelIndexList& )
w->setPanelTitle( tr( "Add ranges to rules" ) );
connect( w, SIGNAL( panelAccepted( QgsPanelWidget* ) ), this, SLOT( refineRuleRangesAccepted( QgsPanelWidget* ) ) );
w->setMapCanvas( mMapCanvas );
w->setDockMode( this->dockMode() );
openPanel( w );
}

Expand Down

0 comments on commit 01ec0e4

Please sign in to comment.