mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Merge pull request #5900 from m-kuhn/layerPropsStyleInTitle
Show style name in layer properties dialog title
This commit is contained in:
commit
f76421db4e
@ -193,6 +193,13 @@ Each call must be paired with restoreOverrideStyle()
|
||||
bool restoreOverrideStyle();
|
||||
%Docstring
|
||||
Restore the original store after a call to setOverrideStyle()
|
||||
%End
|
||||
|
||||
bool isDefault( const QString &styleName ) const;
|
||||
%Docstring
|
||||
Returns true if this is the default style
|
||||
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
signals:
|
||||
|
@ -445,6 +445,9 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv
|
||||
mResetColorRenderingBtn->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionUndo.svg" ) ) );
|
||||
|
||||
QString title = QString( tr( "Layer Properties - %1" ) ).arg( lyr->name() );
|
||||
|
||||
if ( !mRasterLayer->styleManager()->isDefault( mRasterLayer->styleManager()->currentStyle() ) )
|
||||
title += QStringLiteral( " (%1)" ).arg( mRasterLayer->styleManager()->currentStyle() );
|
||||
restoreOptionsBaseUi( title );
|
||||
optionsStackedWidget_CurrentChanged( mOptionsStackedWidget->currentIndex() );
|
||||
} // QgsRasterLayerProperties ctor
|
||||
|
@ -358,6 +358,8 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
|
||||
}
|
||||
|
||||
QString title = QString( tr( "Layer Properties - %1" ) ).arg( mLayer->name() );
|
||||
if ( !mLayer->styleManager()->isDefault( mLayer->styleManager()->currentStyle() ) )
|
||||
title += QStringLiteral( " (%1)" ).arg( mLayer->styleManager()->currentStyle() );
|
||||
restoreOptionsBaseUi( title );
|
||||
|
||||
mLayersDependenciesTreeGroup.reset( QgsProject::instance()->layerTreeRoot()->clone() );
|
||||
|
@ -224,6 +224,11 @@ bool QgsMapLayerStyleManager::restoreOverrideStyle()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QgsMapLayerStyleManager::isDefault( const QString &styleName ) const
|
||||
{
|
||||
return styleName == defaultStyleName();
|
||||
}
|
||||
|
||||
|
||||
// -----
|
||||
|
||||
|
@ -165,6 +165,13 @@ class CORE_EXPORT QgsMapLayerStyleManager : public QObject
|
||||
//! Restore the original store after a call to setOverrideStyle()
|
||||
bool restoreOverrideStyle();
|
||||
|
||||
/**
|
||||
* Returns true if this is the default style
|
||||
*
|
||||
* \since QGIS 3.0
|
||||
*/
|
||||
bool isDefault( const QString &styleName ) const;
|
||||
|
||||
signals:
|
||||
//! Emitted when a new style has been added
|
||||
void styleAdded( const QString &name );
|
||||
|
Loading…
x
Reference in New Issue
Block a user