"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gui/symbology/qgssymbollayerwidget.cpp" between
QGIS-final-3_14_15.tar.gz and QGIS-final-3_14_16.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Latest release (3.14.x series).

qgssymbollayerwidget.cpp  (QGIS-final-3_14_15):qgssymbollayerwidget.cpp  (QGIS-final-3_14_16)
skipping to change at line 2339 skipping to change at line 2339
QString path = idx.data( Qt::UserRole + 1 ).toString(); QString path = idx.data( Qt::UserRole + 1 ).toString();
QAbstractItemModel *oldModel = viewImages->model(); QAbstractItemModel *oldModel = viewImages->model();
QgsSvgSelectorListModel *m = new QgsSvgSelectorListModel( viewImages, path, mI conSize ); QgsSvgSelectorListModel *m = new QgsSvgSelectorListModel( viewImages, path, mI conSize );
viewImages->setModel( m ); viewImages->setModel( m );
delete oldModel; delete oldModel;
connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged, t his, &QgsSvgMarkerSymbolLayerWidget::setName ); connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged, t his, &QgsSvgMarkerSymbolLayerWidget::setName );
} }
void QgsSvgMarkerSymbolLayerWidget::setGuiForSvg( const QgsSvgMarkerSymbolLayer *layer ) void QgsSvgMarkerSymbolLayerWidget::setGuiForSvg( const QgsSvgMarkerSymbolLayer *layer, bool skipDefaultColors )
{ {
if ( !layer ) if ( !layer )
{ {
return; return;
} }
//activate gui for svg parameters only if supported by the svg file //activate gui for svg parameters only if supported by the svg file
bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, h asStrokeOpacityParam; bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, h asStrokeOpacityParam;
QColor defaultFill, defaultStroke; QColor defaultFill, defaultStroke;
double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity; double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
skipping to change at line 2366 skipping to change at line 2366
mChangeColorButton->setEnabled( hasFillParam ); mChangeColorButton->setEnabled( hasFillParam );
mChangeColorButton->setAllowOpacity( hasFillOpacityParam ); mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
mChangeStrokeColorButton->setEnabled( hasStrokeParam ); mChangeStrokeColorButton->setEnabled( hasStrokeParam );
mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam ); mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam ); mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
if ( hasFillParam ) if ( hasFillParam )
{ {
QColor fill = layer->fillColor(); QColor fill = layer->fillColor();
double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0; double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
if ( hasDefaultFillColor ) if ( hasDefaultFillColor && !skipDefaultColors )
{ {
fill = defaultFill; fill = defaultFill;
} }
fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity ); fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
mChangeColorButton->setColor( fill ); mChangeColorButton->setColor( fill );
} }
if ( hasStrokeParam ) if ( hasStrokeParam )
{ {
QColor stroke = layer->strokeColor(); QColor stroke = layer->strokeColor();
double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0; double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
if ( hasDefaultStrokeColor ) if ( hasDefaultStrokeColor && !skipDefaultColors )
{ {
stroke = defaultStroke; stroke = defaultStroke;
} }
stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingO pacity ); stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingO pacity );
mChangeStrokeColorButton->setColor( stroke ); mChangeStrokeColorButton->setColor( stroke );
} }
whileBlocking( mSvgSourceLineEdit )->setSource( layer->path() ); whileBlocking( mSvgSourceLineEdit )->setSource( layer->path() );
mStrokeWidthSpinBox->blockSignals( true ); mStrokeWidthSpinBox->blockSignals( true );
mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : la yer->strokeWidth() ); mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : la yer->strokeWidth() );
mStrokeWidthSpinBox->blockSignals( false ); mStrokeWidthSpinBox->blockSignals( false );
bool preservedAspectRatio = layer->preservedAspectRatio(); bool preservedAspectRatio = layer->preservedAspectRatio();
spinHeight->blockSignals( true ); spinHeight->blockSignals( true );
if ( preservedAspectRatio ) if ( preservedAspectRatio )
{ {
spinHeight->setValue( layer->size() ); spinHeight->setValue( layer->size() * layer->defaultAspectRatio() );
} }
else else
{ {
spinHeight->setValue( layer->size() * layer->fixedAspectRatio() ); spinHeight->setValue( layer->size() * layer->fixedAspectRatio() );
} }
spinHeight->setEnabled( layer->defaultAspectRatio() > 0.0 ); spinHeight->setEnabled( layer->defaultAspectRatio() > 0.0 );
spinHeight->blockSignals( false ); spinHeight->blockSignals( false );
whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio ); whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
} }
skipping to change at line 2483 skipping to change at line 2483
mOffsetUnitWidget->blockSignals( false ); mOffsetUnitWidget->blockSignals( false );
//anchor points //anchor points
mHorizontalAnchorComboBox->blockSignals( true ); mHorizontalAnchorComboBox->blockSignals( true );
mVerticalAnchorComboBox->blockSignals( true ); mVerticalAnchorComboBox->blockSignals( true );
mHorizontalAnchorComboBox->setCurrentIndex( mLayer->horizontalAnchorPoint() ); mHorizontalAnchorComboBox->setCurrentIndex( mLayer->horizontalAnchorPoint() );
mVerticalAnchorComboBox->setCurrentIndex( mLayer->verticalAnchorPoint() ); mVerticalAnchorComboBox->setCurrentIndex( mLayer->verticalAnchorPoint() );
mHorizontalAnchorComboBox->blockSignals( false ); mHorizontalAnchorComboBox->blockSignals( false );
mVerticalAnchorComboBox->blockSignals( false ); mVerticalAnchorComboBox->blockSignals( false );
setGuiForSvg( mLayer ); setGuiForSvg( mLayer, true );
registerDataDefinedButton( mWidthDDBtn, QgsSymbolLayer::PropertyWidth ); registerDataDefinedButton( mWidthDDBtn, QgsSymbolLayer::PropertyWidth );
registerDataDefinedButton( mHeightDDBtn, QgsSymbolLayer::PropertyHeight ); registerDataDefinedButton( mHeightDDBtn, QgsSymbolLayer::PropertyHeight );
registerDataDefinedButton( mStrokeWidthDDBtn, QgsSymbolLayer::PropertyStrokeWi dth ); registerDataDefinedButton( mStrokeWidthDDBtn, QgsSymbolLayer::PropertyStrokeWi dth );
registerDataDefinedButton( mAngleDDBtn, QgsSymbolLayer::PropertyAngle ); registerDataDefinedButton( mAngleDDBtn, QgsSymbolLayer::PropertyAngle );
registerDataDefinedButton( mOffsetDDBtn, QgsSymbolLayer::PropertyOffset ); registerDataDefinedButton( mOffsetDDBtn, QgsSymbolLayer::PropertyOffset );
registerDataDefinedButton( mFilenameDDBtn, QgsSymbolLayer::PropertyName ); registerDataDefinedButton( mFilenameDDBtn, QgsSymbolLayer::PropertyName );
registerDataDefinedButton( mFillColorDDBtn, QgsSymbolLayer::PropertyFillColor ); registerDataDefinedButton( mFillColorDDBtn, QgsSymbolLayer::PropertyFillColor );
registerDataDefinedButton( mStrokeColorDDBtn, QgsSymbolLayer::PropertyStrokeCo lor ); registerDataDefinedButton( mStrokeColorDDBtn, QgsSymbolLayer::PropertyStrokeCo lor );
registerDataDefinedButton( mHorizontalAnchorDDBtn, QgsSymbolLayer::PropertyHor izontalAnchor ); registerDataDefinedButton( mHorizontalAnchorDDBtn, QgsSymbolLayer::PropertyHor izontalAnchor );
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)