Skip to content
Permalink
Browse files

[ui] Disable fill color for stroke-only ellipse symbols

  • Loading branch information
nirvn committed Mar 18, 2021
1 parent 4791fc4 commit 6d64fabe07b138dbdb2943f22a6f9f93a3314007
@@ -51,7 +51,7 @@ Creates the symbol layer
void setSymbolName( const QString &name );
QString symbolName() const;

bool shapeIsFilled( const QString &symbolName ) const;
static bool shapeIsFilled( const QString &symbolName );
%Docstring
Returns ``True`` if a shape has a fill.

@@ -669,7 +669,7 @@ void QgsEllipseSymbolLayer::preparePath( const QString &symbolName, QgsSymbolRen
}
}

bool QgsEllipseSymbolLayer::shapeIsFilled( const QString &symbolName ) const
bool QgsEllipseSymbolLayer::shapeIsFilled( const QString &symbolName )
{
return symbolName == QLatin1String( "cross" ) || symbolName == QLatin1String( "arrow" ) || symbolName == QLatin1String( "half_arc" ) ? false : true;
}
@@ -58,7 +58,7 @@ class CORE_EXPORT QgsEllipseSymbolLayer: public QgsMarkerSymbolLayer
* \returns TRUE if shape uses a fill, or FALSE if shape uses lines only
* \since QGIS 3.20
*/
bool shapeIsFilled( const QString &symbolName ) const;
static bool shapeIsFilled( const QString &symbolName );

void setSize( double size ) override;

@@ -121,6 +121,7 @@ void QgsEllipseSymbolLayerWidget::setSymbolLayer( QgsSymbolLayer *layer )
{
mShapeListWidget->setCurrentItem( symbolItemList.at( 0 ) );
}
btnChangeColorFill->setEnabled( QgsEllipseSymbolLayer::shapeIsFilled( mLayer->symbolName() ) );

//set combo entries to current values
blockComboSignals( true );
@@ -170,6 +171,7 @@ void QgsEllipseSymbolLayerWidget::mShapeListWidget_itemSelectionChanged()
if ( item )
{
mLayer->setSymbolName( item->data( Qt::UserRole ).toString() );
btnChangeColorFill->setEnabled( QgsEllipseSymbolLayer::shapeIsFilled( mLayer->symbolName() ) );
emit changed();
}
}

0 comments on commit 6d64fab

Please sign in to comment.