Skip to content

Commit

Permalink
Add relations icon for style categories
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Dec 19, 2019
1 parent a49e8d6 commit 5784e87
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 14 deletions.
2 changes: 2 additions & 0 deletions images/images.qrc
Expand Up @@ -591,6 +591,8 @@
<file>themes/default/propertyicons/system.svg</file>
<file>themes/default/propertyicons/transparency.svg</file>
<file>themes/default/propertyicons/spacer.svg</file>
<file>themes/default/propertyicons/relations.svg</file>
<file>themes/default/rendererCategorizedSymbol.svg</file>
<file>themes/default/rendererCategorizedSymbol.svg</file>
<file>themes/default/rendererGraduatedSymbol.svg</file>
<file>themes/default/rendererNullSymbol.svg</file>
Expand Down
31 changes: 31 additions & 0 deletions images/themes/default/propertyicons/relations.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 25 additions & 14 deletions src/app/qgsmaplayerstylecategoriesmodel.cpp
Expand Up @@ -77,7 +77,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro

switch ( category )
{
case QgsMapLayer::LayerConfiguration:
case QgsMapLayer::StyleCategory::LayerConfiguration:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -88,7 +88,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/system.svg" ) );
}
break;
case QgsMapLayer::Symbology:
case QgsMapLayer::StyleCategory::Symbology:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -99,7 +99,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/symbology.svg" ) );
}
break;
case QgsMapLayer::Symbology3D:
case QgsMapLayer::StyleCategory::Symbology3D:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -110,7 +110,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/3d.svg" ) );
}
break;
case QgsMapLayer::Labeling:
case QgsMapLayer::StyleCategory::Labeling:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -121,7 +121,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/labels.svg" ) );
}
break;
case QgsMapLayer::Fields:
case QgsMapLayer::StyleCategory::Fields:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -132,7 +132,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/mSourceFields.svg" ) );
}
break;
case QgsMapLayer::Forms:
case QgsMapLayer::StyleCategory::Forms:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -143,7 +143,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/mActionFormView.svg" ) );
}
break;
case QgsMapLayer::Actions:
case QgsMapLayer::StyleCategory::Actions:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -154,7 +154,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/action.svg" ) );
}
break;
case QgsMapLayer::MapTips:
case QgsMapLayer::StyleCategory::MapTips:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -165,7 +165,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/display.svg" ) );
}
break;
case QgsMapLayer::Diagrams:
case QgsMapLayer::StyleCategory::Diagrams:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -176,7 +176,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/diagram.svg" ) );
}
break;
case QgsMapLayer::AttributeTable:
case QgsMapLayer::StyleCategory::AttributeTable:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -187,7 +187,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/mActionOpenTable.svg" ) );
}
break;
case QgsMapLayer::Rendering:
case QgsMapLayer::StyleCategory::Rendering:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -198,7 +198,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/rendering.svg" ) );
}
break;
case QgsMapLayer::CustomProperties:
case QgsMapLayer::StyleCategory::CustomProperties:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -209,7 +209,7 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/mActionOptions.svg" ) );
}
break;
case QgsMapLayer::GeometryOptions:
case QgsMapLayer::StyleCategory::GeometryOptions:
switch ( role )
{
case Qt::DisplayRole:
Expand All @@ -220,7 +220,18 @@ QVariant QgsMapLayerStyleCategoriesModel::data( const QModelIndex &index, int ro
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/digitizing.svg" ) );
}
break;
case QgsMapLayer::AllStyleCategories:
case QgsMapLayer::StyleCategory::Relations:
switch ( role )
{
case Qt::DisplayRole:
return tr( "Relations" );
case Qt::ToolTipRole:
return tr( "Relations with other layers" );
case Qt::DecorationRole:
return QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/relations.svg" ) );
}
break;
case QgsMapLayer::StyleCategory::AllStyleCategories:
switch ( role )
{
case Qt::DisplayRole:
Expand Down

0 comments on commit 5784e87

Please sign in to comment.