mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
Update 3D canvas active map theme name
This commit is contained in:
parent
1ad5c43c4e
commit
23585d4142
@ -103,6 +103,7 @@ Qgs3DMapCanvasDockWidget::Qgs3DMapCanvasDockWidget( QWidget *parent )
|
||||
// Map Theme Menu
|
||||
mMapThemeMenu = new QMenu();
|
||||
connect( mMapThemeMenu, &QMenu::aboutToShow, this, &Qgs3DMapCanvasDockWidget::mapThemeMenuAboutToShow );
|
||||
connect( QgsProject::instance()->mapThemeCollection(), &QgsMapThemeCollection::mapThemeRenamed, this, &Qgs3DMapCanvasDockWidget::currentMapThemeRenamed );
|
||||
|
||||
mBtnMapThemes = new QToolButton();
|
||||
mBtnMapThemes->setAutoRaise( true );
|
||||
@ -344,3 +345,11 @@ void Qgs3DMapCanvasDockWidget::mapThemeMenuAboutToShow()
|
||||
}
|
||||
mMapThemeMenu->addActions( mMapThemeMenuPresetActions );
|
||||
}
|
||||
|
||||
void Qgs3DMapCanvasDockWidget::currentMapThemeRenamed( const QString &theme, const QString &newTheme )
|
||||
{
|
||||
if ( theme == mCanvas->map()->terrainMapTheme() )
|
||||
{
|
||||
mCanvas->map()->setTerrainMapTheme( newTheme );
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ class APP_EXPORT Qgs3DMapCanvasDockWidget : public QgsDockWidget
|
||||
void onMainCanvasColorChanged();
|
||||
void onTotalPendingJobsCountChanged();
|
||||
void mapThemeMenuAboutToShow();
|
||||
void currentMapThemeRenamed( const QString &theme, const QString &newTheme );
|
||||
|
||||
private:
|
||||
Qgs3DMapCanvas *mCanvas = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user