Skip to content
Permalink
Browse files

Add relations icon for style categories

  • Loading branch information
elpaso committed Dec 8, 2019
1 parent a49e8d6 commit 5784e873a43b2d8bfc628b9d4a3340275f09af66
Showing with 58 additions and 14 deletions.
  1. +2 −0 images/images.qrc
  2. +31 −0 images/themes/default/propertyicons/relations.svg
  3. +25 −14 src/app/qgsmaplayerstylecategoriesmodel.cpp
@@ -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>
@@ -0,0 +1,31 @@
<svg height="32" width="32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="5.6324644" x2="10.6324644" y1="3.7047943" y2="15.7047943">
<stop offset="0" stop-color="#f1f1f1"/>
<stop offset="1" stop-color="#d6d6d6"/>
</linearGradient>
<path d="m10.283011 8.3578359l10.139192.00203v7.8920306" fill="none" stroke="#2b3b4d"/>
<g fill-rule="evenodd" stroke="#888a85" stroke-linecap="round" stroke-linejoin="round" transform="translate(-.431455 -.14381833)">
<rect fill="url(#a)" height="15" overflow="visible" rx="1" width="13" x="2.6324642" y="1.7047944"/>
<path d="m2.6324644 5.7047943l12.9999996 0" fill="#eeeeec" overflow="visible"/>
<path d="m4.6324644 8.7047943l2 0" fill="#eeeeec" overflow="visible"/>
<path d="m4.6324644 11.704794l2 0" fill="#eeeeec" overflow="visible"/>
<path d="m4.6324644 14.704795l2 0" fill="#eeeeec" overflow="visible"/>
<path d="m9.6324641 8.7047943l3.9999999 0" fill="#eeeeec" overflow="visible"/>
<path d="m9.5703417 11.663069l4.0621223.04172" fill="#eeeeec" overflow="visible"/>
<path d="m9.6324641 14.704795l3.9999999 0" fill="#eeeeec" overflow="visible"/>
<path d="m4.7035514 3.7105107l1.928913-.00572" fill="#eeeeec" overflow="visible"/>
<path d="m9.6324641 3.7047943l3.9999999 0" fill="#eeeeec" overflow="visible"/>
</g>
<g fill-rule="evenodd" stroke="#888a85" stroke-linecap="round" stroke-linejoin="round" transform="translate(14.885197 13.80656)">
<rect fill="url(#a)" height="15" overflow="visible" rx="1" width="13" x="2.6324642" y="1.7047944"/>
<path d="m2.6324644 5.7047943l12.9999996 0" fill="#eeeeec" overflow="visible"/>
<path d="m4.6324644 8.7047943l2 0" fill="#eeeeec" overflow="visible"/>
<path d="m4.6324644 11.704794l2 0" fill="#eeeeec" overflow="visible"/>
<path d="m4.6324644 14.704795l2 0" fill="#eeeeec" overflow="visible"/>
<path d="m9.6324641 8.7047943l3.9999999 0" fill="#eeeeec" overflow="visible"/>
<path d="m9.5703417 11.663069l4.0621223.04172" fill="#eeeeec" overflow="visible"/>
<path d="m9.6324641 14.704795l3.9999999 0" fill="#eeeeec" overflow="visible"/>
<path d="m4.7035514 3.7105107l1.928913-.00572" fill="#eeeeec" overflow="visible"/>
<path d="m9.6324641 3.7047943l3.9999999 0" fill="#eeeeec" overflow="visible"/>
</g>
</svg>
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:

0 comments on commit 5784e87

Please sign in to comment.
You can’t perform that action at this time.