Skip to content

Commit 95f8973

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 0c4846b + def6486 commit 95f8973

13 files changed

+351
-414
lines changed

src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ void QgsEllipseSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
5959
mRotationSpinBox->setValue( mLayer->angle() );
6060
mOutlineWidthSpinBox->setValue( mLayer->outlineWidth() );
6161

62+
btnChangeColorBorder->setColor( mLayer->outlineColor() );
63+
btnChangeColorFill->setColor( mLayer->fillColor() );
64+
6265
QList<QListWidgetItem *> symbolItemList = mShapeListWidget->findItems( mLayer->symbolName(), Qt::MatchExactly );
6366
if ( symbolItemList.size() > 0 )
6467
{
@@ -192,6 +195,7 @@ void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_clicked()
192195
if ( newColor.isValid() )
193196
{
194197
mLayer->setOutlineColor( newColor );
198+
btnChangeColorBorder->setColor( newColor );
195199
emit changed();
196200
}
197201
}
@@ -205,6 +209,7 @@ void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_clicked()
205209
if ( newColor.isValid() )
206210
{
207211
mLayer->setFillColor( newColor );
212+
btnChangeColorFill->setColor( newColor );
208213
emit changed();
209214
}
210215
}

src/gui/symbology-ng/qgssymbollayerv2widget.cpp

+15-36
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,11 @@ void QgsSvgMarkerSymbolLayerV2Widget::setGuiForSvg( const QgsSvgMarkerSymbolLaye
671671
mChangeBorderColorButton->setEnabled( hasOutlineParam );
672672
mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );
673673

674+
if ( hasFillParam )
675+
mChangeColorButton->setColor( defaultFill );
676+
if ( hasOutlineParam )
677+
mChangeBorderColorButton->setColor( defaultOutline );
678+
674679
mFileLineEdit->blockSignals( true );
675680
mFileLineEdit->setText( layer->path() );
676681
mFileLineEdit->blockSignals( false );
@@ -795,6 +800,7 @@ void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeColorButton_clicked()
795800
if ( c.isValid() )
796801
{
797802
mLayer->setFillColor( c );
803+
mChangeColorButton->setColor( c );
798804
emit changed();
799805
}
800806
}
@@ -809,6 +815,7 @@ void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeBorderColorButton_clicked()
809815
if ( c.isValid() )
810816
{
811817
mLayer->setOutlineColor( c );
818+
mChangeBorderColorButton->setColor( c );
812819
emit changed();
813820
}
814821
}
@@ -886,7 +893,6 @@ QgsSVGFillSymbolLayerWidget::QgsSVGFillSymbolLayerWidget( const QgsVectorLayer*
886893
setupUi( this );
887894
mSvgTreeView->setHeaderHidden( true );
888895
insertIcons();
889-
updateOutlineIcon();
890896

891897
connect( mSvgListView->selectionModel(), SIGNAL( currentChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( setFile( const QModelIndex& ) ) );
892898
connect( mSvgTreeView->selectionModel(), SIGNAL( currentChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( populateIcons( const QModelIndex& ) ) );
@@ -912,7 +918,6 @@ void QgsSVGFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* layer )
912918
mSVGLineEdit->setText( mLayer->svgFilePath() );
913919
mRotationSpinBox->setValue( mLayer->angle() );
914920
}
915-
updateOutlineIcon();
916921
updateParamGui();
917922
}
918923

@@ -989,17 +994,6 @@ void QgsSVGFillSymbolLayerWidget::populateIcons( const QModelIndex& idx )
989994
emit changed();
990995
}
991996

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-
}
1003997

1004998
void QgsSVGFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged( double d )
1005999
{
@@ -1010,23 +1004,18 @@ void QgsSVGFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged( double d )
10101004
emit changed();
10111005
}
10121006

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-
10221007
void QgsSVGFillSymbolLayerWidget::updateParamGui()
10231008
{
10241009
//activate gui for svg parameters only if supported by the svg file
10251010
bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
10261011
QColor defaultFill, defaultOutline;
10271012
double defaultOutlineWidth;
10281013
QgsSvgCache::instance()->containsParams( mSVGLineEdit->text(), hasFillParam, defaultFill, hasOutlineParam, defaultOutline, hasOutlineWidthParam, defaultOutlineWidth );
1014+
if ( hasFillParam )
1015+
mChangeColorButton->setColor( defaultFill );
10291016
mChangeColorButton->setEnabled( hasFillParam );
1017+
if ( hasOutlineParam )
1018+
mChangeBorderColorButton->setColor( defaultOutline );
10301019
mChangeBorderColorButton->setEnabled( hasOutlineParam );
10311020
mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );
10321021
}
@@ -1041,6 +1030,7 @@ void QgsSVGFillSymbolLayerWidget::on_mChangeColorButton_clicked()
10411030
if ( c.isValid() )
10421031
{
10431032
mLayer->setSvgFillColor( c );
1033+
mChangeColorButton->setColor( c );
10441034
emit changed();
10451035
}
10461036
}
@@ -1055,6 +1045,7 @@ void QgsSVGFillSymbolLayerWidget::on_mChangeBorderColorButton_clicked()
10551045
if ( c.isValid() )
10561046
{
10571047
mLayer->setSvgOutlineColor( c );
1048+
mChangeBorderColorButton->setColor( c );
10581049
emit changed();
10591050
}
10601051
}
@@ -1091,6 +1082,7 @@ void QgsLinePatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* laye
10911082
mDistanceSpinBox->setValue( mLayer->distance() );
10921083
mLineWidthSpinBox->setValue( mLayer->lineWidth() );
10931084
mOffsetSpinBox->setValue( mLayer->offset() );
1085+
mColorPushButton->setColor( mLayer->color() );
10941086
}
10951087
}
10961088

@@ -1143,25 +1135,12 @@ void QgsLinePatternFillSymbolLayerWidget::on_mColorPushButton_clicked()
11431135
if ( c.isValid() )
11441136
{
11451137
mLayer->setColor( c );
1138+
mColorPushButton->setColor( c );
11461139
emit changed();
11471140
}
11481141
}
11491142
}
11501143

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-
}
11651144

11661145
/////////////
11671146

src/gui/symbology-ng/qgssymbollayerv2widget.h

-3
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, pr
261261
protected:
262262
QgsSVGFillSymbolLayer* mLayer;
263263
void insertIcons();
264-
void updateOutlineIcon();
265264
void updateParamGui();
266265

267266
private slots:
@@ -270,7 +269,6 @@ class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, pr
270269
void on_mSVGLineEdit_textChanged( const QString & text );
271270
void setFile( const QModelIndex& item );
272271
void populateIcons( const QModelIndex& item );
273-
void on_mChangeOutlinePushButton_clicked();
274272
void on_mRotationSpinBox_valueChanged( double d );
275273
void on_mChangeColorButton_clicked();
276274
void on_mChangeBorderColorButton_clicked();
@@ -304,7 +302,6 @@ class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Wi
304302
void on_mLineWidthSpinBox_valueChanged( double d );
305303
void on_mOffsetSpinBox_valueChanged( double d );
306304
void on_mColorPushButton_clicked();
307-
void on_mOutlinePushButton_clicked();
308305
};
309306

310307
//////////

src/ui/symbollayer/widget_ellipse.ui

+16-3
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,32 @@
220220
</property>
221221
</widget>
222222
</item>
223-
<item row="6" column="1">
224-
<widget class="QComboBox" name="mDDShapeComboBox"/>
225-
</item>
226223
<item row="2" column="1">
227224
<widget class="QComboBox" name="mDDRotationComboBox"/>
228225
</item>
226+
<item row="6" column="1">
227+
<widget class="QComboBox" name="mDDShapeComboBox"/>
228+
</item>
229229
<item row="2" column="0">
230230
<widget class="QLabel" name="mDDRotationLabel">
231231
<property name="text">
232232
<string>Rotation</string>
233233
</property>
234234
</widget>
235235
</item>
236+
<item row="7" column="0" colspan="2">
237+
<spacer name="verticalSpacer">
238+
<property name="orientation">
239+
<enum>Qt::Vertical</enum>
240+
</property>
241+
<property name="sizeHint" stdset="0">
242+
<size>
243+
<width>20</width>
244+
<height>40</height>
245+
</size>
246+
</property>
247+
</spacer>
248+
</item>
236249
</layout>
237250
</widget>
238251
</widget>

src/ui/symbollayer/widget_fontmarker.ui

+41-41
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>400</width>
9+
<width>399</width>
1010
<height>300</height>
1111
</rect>
1212
</property>
@@ -31,20 +31,10 @@
3131
<property name="horizontalSpacing">
3232
<number>6</number>
3333
</property>
34-
<item row="0" column="0">
35-
<widget class="QLabel" name="label">
36-
<property name="text">
37-
<string>Font family</string>
38-
</property>
39-
</widget>
40-
</item>
41-
<item row="0" column="1" colspan="2">
42-
<widget class="QFontComboBox" name="cboFont"/>
43-
</item>
44-
<item row="1" column="0">
45-
<widget class="QLabel" name="label_3">
34+
<item row="2" column="0">
35+
<widget class="QLabel" name="label_2">
4636
<property name="text">
47-
<string>Color</string>
37+
<string>Size</string>
4838
</property>
4939
</widget>
5040
</item>
@@ -55,17 +45,10 @@
5545
</property>
5646
</widget>
5747
</item>
58-
<item row="2" column="0">
59-
<widget class="QLabel" name="label_2">
60-
<property name="text">
61-
<string>Size</string>
62-
</property>
63-
</widget>
64-
</item>
65-
<item row="3" column="0">
66-
<widget class="QLabel" name="label_4">
48+
<item row="0" column="0">
49+
<widget class="QLabel" name="label">
6750
<property name="text">
68-
<string>Rotation</string>
51+
<string>Font family</string>
6952
</property>
7053
</widget>
7154
</item>
@@ -82,23 +65,6 @@
8265
</property>
8366
</widget>
8467
</item>
85-
<item row="2" column="1">
86-
<widget class="QDoubleSpinBox" name="spinSize">
87-
<property name="decimals">
88-
<number>5</number>
89-
</property>
90-
<property name="value">
91-
<double>12.000000000000000</double>
92-
</property>
93-
</widget>
94-
</item>
95-
<item row="4" column="0">
96-
<widget class="QLabel" name="label_5">
97-
<property name="text">
98-
<string>Offset X,Y</string>
99-
</property>
100-
</widget>
101-
</item>
10268
<item row="4" column="1">
10369
<layout class="QHBoxLayout" name="horizontalLayout">
10470
<item>
@@ -129,6 +95,40 @@
12995
</item>
13096
</layout>
13197
</item>
98+
<item row="4" column="0">
99+
<widget class="QLabel" name="label_5">
100+
<property name="text">
101+
<string>Offset X,Y</string>
102+
</property>
103+
</widget>
104+
</item>
105+
<item row="1" column="0">
106+
<widget class="QLabel" name="label_3">
107+
<property name="text">
108+
<string>Color</string>
109+
</property>
110+
</widget>
111+
</item>
112+
<item row="2" column="1">
113+
<widget class="QDoubleSpinBox" name="spinSize">
114+
<property name="decimals">
115+
<number>5</number>
116+
</property>
117+
<property name="value">
118+
<double>12.000000000000000</double>
119+
</property>
120+
</widget>
121+
</item>
122+
<item row="3" column="0">
123+
<widget class="QLabel" name="label_4">
124+
<property name="text">
125+
<string>Rotation</string>
126+
</property>
127+
</widget>
128+
</item>
129+
<item row="0" column="1">
130+
<widget class="QFontComboBox" name="cboFont"/>
131+
</item>
132132
</layout>
133133
</item>
134134
<item>

0 commit comments

Comments
 (0)