@@ -671,6 +671,11 @@ void QgsSvgMarkerSymbolLayerV2Widget::setGuiForSvg( const QgsSvgMarkerSymbolLaye
671
671
mChangeBorderColorButton ->setEnabled ( hasOutlineParam );
672
672
mBorderWidthSpinBox ->setEnabled ( hasOutlineWidthParam );
673
673
674
+ if ( hasFillParam )
675
+ mChangeColorButton ->setColor ( defaultFill );
676
+ if ( hasOutlineParam )
677
+ mChangeBorderColorButton ->setColor ( defaultOutline );
678
+
674
679
mFileLineEdit ->blockSignals ( true );
675
680
mFileLineEdit ->setText ( layer->path () );
676
681
mFileLineEdit ->blockSignals ( false );
@@ -795,6 +800,7 @@ void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeColorButton_clicked()
795
800
if ( c.isValid () )
796
801
{
797
802
mLayer ->setFillColor ( c );
803
+ mChangeColorButton ->setColor ( c );
798
804
emit changed ();
799
805
}
800
806
}
@@ -809,6 +815,7 @@ void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeBorderColorButton_clicked()
809
815
if ( c.isValid () )
810
816
{
811
817
mLayer ->setOutlineColor ( c );
818
+ mChangeBorderColorButton ->setColor ( c );
812
819
emit changed ();
813
820
}
814
821
}
@@ -886,7 +893,6 @@ QgsSVGFillSymbolLayerWidget::QgsSVGFillSymbolLayerWidget( const QgsVectorLayer*
886
893
setupUi ( this );
887
894
mSvgTreeView ->setHeaderHidden ( true );
888
895
insertIcons ();
889
- updateOutlineIcon ();
890
896
891
897
connect ( mSvgListView ->selectionModel (), SIGNAL ( currentChanged ( const QModelIndex&, const QModelIndex& ) ), this , SLOT ( setFile ( const QModelIndex& ) ) );
892
898
connect ( mSvgTreeView ->selectionModel (), SIGNAL ( currentChanged ( const QModelIndex&, const QModelIndex& ) ), this , SLOT ( populateIcons ( const QModelIndex& ) ) );
@@ -912,7 +918,6 @@ void QgsSVGFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* layer )
912
918
mSVGLineEdit ->setText ( mLayer ->svgFilePath () );
913
919
mRotationSpinBox ->setValue ( mLayer ->angle () );
914
920
}
915
- updateOutlineIcon ();
916
921
updateParamGui ();
917
922
}
918
923
@@ -989,17 +994,6 @@ void QgsSVGFillSymbolLayerWidget::populateIcons( const QModelIndex& idx )
989
994
emit changed ();
990
995
}
991
996
992
- void QgsSVGFillSymbolLayerWidget::on_mChangeOutlinePushButton_clicked ()
993
- {
994
- QgsSymbolV2SelectorDialog dlg ( mLayer ->subSymbol (), QgsStyleV2::defaultStyle (), mVectorLayer , this );
995
- if ( dlg.exec () == QDialog::Rejected )
996
- {
997
- return ;
998
- }
999
-
1000
- updateOutlineIcon ();
1001
- emit changed ();
1002
- }
1003
997
1004
998
void QgsSVGFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged ( double d )
1005
999
{
@@ -1010,23 +1004,18 @@ void QgsSVGFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged( double d )
1010
1004
emit changed ();
1011
1005
}
1012
1006
1013
- void QgsSVGFillSymbolLayerWidget::updateOutlineIcon ()
1014
- {
1015
- if ( mLayer )
1016
- {
1017
- QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon ( mLayer ->subSymbol (), mChangeOutlinePushButton ->iconSize () );
1018
- mChangeOutlinePushButton ->setIcon ( icon );
1019
- }
1020
- }
1021
-
1022
1007
void QgsSVGFillSymbolLayerWidget::updateParamGui ()
1023
1008
{
1024
1009
// activate gui for svg parameters only if supported by the svg file
1025
1010
bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
1026
1011
QColor defaultFill, defaultOutline;
1027
1012
double defaultOutlineWidth;
1028
1013
QgsSvgCache::instance ()->containsParams ( mSVGLineEdit ->text (), hasFillParam, defaultFill, hasOutlineParam, defaultOutline, hasOutlineWidthParam, defaultOutlineWidth );
1014
+ if ( hasFillParam )
1015
+ mChangeColorButton ->setColor ( defaultFill );
1029
1016
mChangeColorButton ->setEnabled ( hasFillParam );
1017
+ if ( hasOutlineParam )
1018
+ mChangeBorderColorButton ->setColor ( defaultOutline );
1030
1019
mChangeBorderColorButton ->setEnabled ( hasOutlineParam );
1031
1020
mBorderWidthSpinBox ->setEnabled ( hasOutlineWidthParam );
1032
1021
}
@@ -1041,6 +1030,7 @@ void QgsSVGFillSymbolLayerWidget::on_mChangeColorButton_clicked()
1041
1030
if ( c.isValid () )
1042
1031
{
1043
1032
mLayer ->setSvgFillColor ( c );
1033
+ mChangeColorButton ->setColor ( c );
1044
1034
emit changed ();
1045
1035
}
1046
1036
}
@@ -1055,6 +1045,7 @@ void QgsSVGFillSymbolLayerWidget::on_mChangeBorderColorButton_clicked()
1055
1045
if ( c.isValid () )
1056
1046
{
1057
1047
mLayer ->setSvgOutlineColor ( c );
1048
+ mChangeBorderColorButton ->setColor ( c );
1058
1049
emit changed ();
1059
1050
}
1060
1051
}
@@ -1091,6 +1082,7 @@ void QgsLinePatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* laye
1091
1082
mDistanceSpinBox ->setValue ( mLayer ->distance () );
1092
1083
mLineWidthSpinBox ->setValue ( mLayer ->lineWidth () );
1093
1084
mOffsetSpinBox ->setValue ( mLayer ->offset () );
1085
+ mColorPushButton ->setColor ( mLayer ->color () );
1094
1086
}
1095
1087
}
1096
1088
@@ -1143,25 +1135,12 @@ void QgsLinePatternFillSymbolLayerWidget::on_mColorPushButton_clicked()
1143
1135
if ( c.isValid () )
1144
1136
{
1145
1137
mLayer ->setColor ( c );
1138
+ mColorPushButton ->setColor ( c );
1146
1139
emit changed ();
1147
1140
}
1148
1141
}
1149
1142
}
1150
1143
1151
- void QgsLinePatternFillSymbolLayerWidget::on_mOutlinePushButton_clicked ()
1152
- {
1153
- if ( mLayer )
1154
- {
1155
- QgsSymbolV2SelectorDialog dlg ( mLayer ->subSymbol (), QgsStyleV2::defaultStyle (), mVectorLayer , this );
1156
- if ( dlg.exec () == QDialog::Rejected )
1157
- {
1158
- return ;
1159
- }
1160
-
1161
- // updateOutlineIcon();
1162
- emit changed ();
1163
- }
1164
- }
1165
1144
1166
1145
// ///////////
1167
1146
0 commit comments