Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[ui] Disable fill color for stroke-only ellipse symbols
- Loading branch information
|
@@ -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(); |
|
|
} |
|
|
} |
|
|