Skip to content
Permalink
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information
alexbruy committed Oct 11, 2012
2 parents 0c4846b + def6486 commit 95f89733ef2b4d28f1bfcf9ba07acb1c65010706
@@ -59,6 +59,9 @@ void QgsEllipseSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
mRotationSpinBox->setValue( mLayer->angle() );
mOutlineWidthSpinBox->setValue( mLayer->outlineWidth() );

btnChangeColorBorder->setColor( mLayer->outlineColor() );
btnChangeColorFill->setColor( mLayer->fillColor() );

QList<QListWidgetItem *> symbolItemList = mShapeListWidget->findItems( mLayer->symbolName(), Qt::MatchExactly );
if ( symbolItemList.size() > 0 )
{
@@ -192,6 +195,7 @@ void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_clicked()
if ( newColor.isValid() )
{
mLayer->setOutlineColor( newColor );
btnChangeColorBorder->setColor( newColor );
emit changed();
}
}
@@ -205,6 +209,7 @@ void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_clicked()
if ( newColor.isValid() )
{
mLayer->setFillColor( newColor );
btnChangeColorFill->setColor( newColor );
emit changed();
}
}
@@ -671,6 +671,11 @@ void QgsSvgMarkerSymbolLayerV2Widget::setGuiForSvg( const QgsSvgMarkerSymbolLaye
mChangeBorderColorButton->setEnabled( hasOutlineParam );
mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );

if ( hasFillParam )
mChangeColorButton->setColor( defaultFill );
if ( hasOutlineParam )
mChangeBorderColorButton->setColor( defaultOutline );

mFileLineEdit->blockSignals( true );
mFileLineEdit->setText( layer->path() );
mFileLineEdit->blockSignals( false );
@@ -795,6 +800,7 @@ void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeColorButton_clicked()
if ( c.isValid() )
{
mLayer->setFillColor( c );
mChangeColorButton->setColor( c );
emit changed();
}
}
@@ -809,6 +815,7 @@ void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeBorderColorButton_clicked()
if ( c.isValid() )
{
mLayer->setOutlineColor( c );
mChangeBorderColorButton->setColor( c );
emit changed();
}
}
@@ -886,7 +893,6 @@ QgsSVGFillSymbolLayerWidget::QgsSVGFillSymbolLayerWidget( const QgsVectorLayer*
setupUi( this );
mSvgTreeView->setHeaderHidden( true );
insertIcons();
updateOutlineIcon();

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

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

void QgsSVGFillSymbolLayerWidget::on_mChangeOutlinePushButton_clicked()
{
QgsSymbolV2SelectorDialog dlg( mLayer->subSymbol(), QgsStyleV2::defaultStyle(), mVectorLayer, this );
if ( dlg.exec() == QDialog::Rejected )
{
return;
}

updateOutlineIcon();
emit changed();
}

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

void QgsSVGFillSymbolLayerWidget::updateOutlineIcon()
{
if ( mLayer )
{
QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( mLayer->subSymbol(), mChangeOutlinePushButton->iconSize() );
mChangeOutlinePushButton->setIcon( icon );
}
}

void QgsSVGFillSymbolLayerWidget::updateParamGui()
{
//activate gui for svg parameters only if supported by the svg file
bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
QColor defaultFill, defaultOutline;
double defaultOutlineWidth;
QgsSvgCache::instance()->containsParams( mSVGLineEdit->text(), hasFillParam, defaultFill, hasOutlineParam, defaultOutline, hasOutlineWidthParam, defaultOutlineWidth );
if ( hasFillParam )
mChangeColorButton->setColor( defaultFill );
mChangeColorButton->setEnabled( hasFillParam );
if ( hasOutlineParam )
mChangeBorderColorButton->setColor( defaultOutline );
mChangeBorderColorButton->setEnabled( hasOutlineParam );
mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );
}
@@ -1041,6 +1030,7 @@ void QgsSVGFillSymbolLayerWidget::on_mChangeColorButton_clicked()
if ( c.isValid() )
{
mLayer->setSvgFillColor( c );
mChangeColorButton->setColor( c );
emit changed();
}
}
@@ -1055,6 +1045,7 @@ void QgsSVGFillSymbolLayerWidget::on_mChangeBorderColorButton_clicked()
if ( c.isValid() )
{
mLayer->setSvgOutlineColor( c );
mChangeBorderColorButton->setColor( c );
emit changed();
}
}
@@ -1091,6 +1082,7 @@ void QgsLinePatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* laye
mDistanceSpinBox->setValue( mLayer->distance() );
mLineWidthSpinBox->setValue( mLayer->lineWidth() );
mOffsetSpinBox->setValue( mLayer->offset() );
mColorPushButton->setColor( mLayer->color() );
}
}

@@ -1143,25 +1135,12 @@ void QgsLinePatternFillSymbolLayerWidget::on_mColorPushButton_clicked()
if ( c.isValid() )
{
mLayer->setColor( c );
mColorPushButton->setColor( c );
emit changed();
}
}
}

void QgsLinePatternFillSymbolLayerWidget::on_mOutlinePushButton_clicked()
{
if ( mLayer )
{
QgsSymbolV2SelectorDialog dlg( mLayer->subSymbol(), QgsStyleV2::defaultStyle(), mVectorLayer, this );
if ( dlg.exec() == QDialog::Rejected )
{
return;
}

//updateOutlineIcon();
emit changed();
}
}

/////////////

@@ -261,7 +261,6 @@ class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, pr
protected:
QgsSVGFillSymbolLayer* mLayer;
void insertIcons();
void updateOutlineIcon();
void updateParamGui();

private slots:
@@ -270,7 +269,6 @@ class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, pr
void on_mSVGLineEdit_textChanged( const QString & text );
void setFile( const QModelIndex& item );
void populateIcons( const QModelIndex& item );
void on_mChangeOutlinePushButton_clicked();
void on_mRotationSpinBox_valueChanged( double d );
void on_mChangeColorButton_clicked();
void on_mChangeBorderColorButton_clicked();
@@ -304,7 +302,6 @@ class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Wi
void on_mLineWidthSpinBox_valueChanged( double d );
void on_mOffsetSpinBox_valueChanged( double d );
void on_mColorPushButton_clicked();
void on_mOutlinePushButton_clicked();
};

//////////
@@ -220,19 +220,32 @@
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="mDDShapeComboBox"/>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="mDDRotationComboBox"/>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="mDDShapeComboBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mDDRotationLabel">
<property name="text">
<string>Rotation</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<width>399</width>
<height>300</height>
</rect>
</property>
@@ -31,20 +31,10 @@
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Font family</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QFontComboBox" name="cboFont"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Color</string>
<string>Size</string>
</property>
</widget>
</item>
@@ -55,17 +45,10 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Size</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Rotation</string>
<string>Font family</string>
</property>
</widget>
</item>
@@ -82,23 +65,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinSize">
<property name="decimals">
<number>5</number>
</property>
<property name="value">
<double>12.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Offset X,Y</string>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@@ -129,6 +95,40 @@
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Offset X,Y</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinSize">
<property name="decimals">
<number>5</number>
</property>
<property name="value">
<double>12.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Rotation</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="cboFont"/>
</item>
</layout>
</item>
<item>

0 comments on commit 95f8973

Please sign in to comment.
You can’t perform that action at this time.