Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Oct 11, 2012
2 parents 0c4846b + def6486 commit 95f8973
Show file tree
Hide file tree
Showing 13 changed files with 351 additions and 414 deletions.
5 changes: 5 additions & 0 deletions src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp
Expand Up @@ -59,6 +59,9 @@ void QgsEllipseSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
mRotationSpinBox->setValue( mLayer->angle() ); mRotationSpinBox->setValue( mLayer->angle() );
mOutlineWidthSpinBox->setValue( mLayer->outlineWidth() ); mOutlineWidthSpinBox->setValue( mLayer->outlineWidth() );


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

QList<QListWidgetItem *> symbolItemList = mShapeListWidget->findItems( mLayer->symbolName(), Qt::MatchExactly ); QList<QListWidgetItem *> symbolItemList = mShapeListWidget->findItems( mLayer->symbolName(), Qt::MatchExactly );
if ( symbolItemList.size() > 0 ) if ( symbolItemList.size() > 0 )
{ {
Expand Down Expand Up @@ -192,6 +195,7 @@ void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_clicked()
if ( newColor.isValid() ) if ( newColor.isValid() )
{ {
mLayer->setOutlineColor( newColor ); mLayer->setOutlineColor( newColor );
btnChangeColorBorder->setColor( newColor );
emit changed(); emit changed();
} }
} }
Expand All @@ -205,6 +209,7 @@ void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_clicked()
if ( newColor.isValid() ) if ( newColor.isValid() )
{ {
mLayer->setFillColor( newColor ); mLayer->setFillColor( newColor );
btnChangeColorFill->setColor( newColor );
emit changed(); emit changed();
} }
} }
Expand Down
51 changes: 15 additions & 36 deletions src/gui/symbology-ng/qgssymbollayerv2widget.cpp
Expand Up @@ -671,6 +671,11 @@ void QgsSvgMarkerSymbolLayerV2Widget::setGuiForSvg( const QgsSvgMarkerSymbolLaye
mChangeBorderColorButton->setEnabled( hasOutlineParam ); mChangeBorderColorButton->setEnabled( hasOutlineParam );
mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam ); mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );


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

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


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


Expand Down Expand Up @@ -989,17 +994,6 @@ void QgsSVGFillSymbolLayerWidget::populateIcons( const QModelIndex& idx )
emit changed(); 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 ) void QgsSVGFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged( double d )
{ {
Expand All @@ -1010,23 +1004,18 @@ void QgsSVGFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged( double d )
emit changed(); emit changed();
} }


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

void QgsSVGFillSymbolLayerWidget::updateParamGui() void QgsSVGFillSymbolLayerWidget::updateParamGui()
{ {
//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, hasOutlineParam, hasOutlineWidthParam; bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
QColor defaultFill, defaultOutline; QColor defaultFill, defaultOutline;
double defaultOutlineWidth; double defaultOutlineWidth;
QgsSvgCache::instance()->containsParams( mSVGLineEdit->text(), hasFillParam, defaultFill, hasOutlineParam, defaultOutline, hasOutlineWidthParam, defaultOutlineWidth ); QgsSvgCache::instance()->containsParams( mSVGLineEdit->text(), hasFillParam, defaultFill, hasOutlineParam, defaultOutline, hasOutlineWidthParam, defaultOutlineWidth );
if ( hasFillParam )
mChangeColorButton->setColor( defaultFill );
mChangeColorButton->setEnabled( hasFillParam ); mChangeColorButton->setEnabled( hasFillParam );
if ( hasOutlineParam )
mChangeBorderColorButton->setColor( defaultOutline );
mChangeBorderColorButton->setEnabled( hasOutlineParam ); mChangeBorderColorButton->setEnabled( hasOutlineParam );
mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam ); mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );
} }
Expand All @@ -1041,6 +1030,7 @@ void QgsSVGFillSymbolLayerWidget::on_mChangeColorButton_clicked()
if ( c.isValid() ) if ( c.isValid() )
{ {
mLayer->setSvgFillColor( c ); mLayer->setSvgFillColor( c );
mChangeColorButton->setColor( c );
emit changed(); emit changed();
} }
} }
Expand All @@ -1055,6 +1045,7 @@ void QgsSVGFillSymbolLayerWidget::on_mChangeBorderColorButton_clicked()
if ( c.isValid() ) if ( c.isValid() )
{ {
mLayer->setSvgOutlineColor( c ); mLayer->setSvgOutlineColor( c );
mChangeBorderColorButton->setColor( c );
emit changed(); emit changed();
} }
} }
Expand Down Expand Up @@ -1091,6 +1082,7 @@ void QgsLinePatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* laye
mDistanceSpinBox->setValue( mLayer->distance() ); mDistanceSpinBox->setValue( mLayer->distance() );
mLineWidthSpinBox->setValue( mLayer->lineWidth() ); mLineWidthSpinBox->setValue( mLayer->lineWidth() );
mOffsetSpinBox->setValue( mLayer->offset() ); mOffsetSpinBox->setValue( mLayer->offset() );
mColorPushButton->setColor( mLayer->color() );
} }
} }


Expand Down Expand Up @@ -1143,25 +1135,12 @@ void QgsLinePatternFillSymbolLayerWidget::on_mColorPushButton_clicked()
if ( c.isValid() ) if ( c.isValid() )
{ {
mLayer->setColor( c ); mLayer->setColor( c );
mColorPushButton->setColor( c );
emit changed(); 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();
}
}


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


Expand Down
3 changes: 0 additions & 3 deletions src/gui/symbology-ng/qgssymbollayerv2widget.h
Expand Up @@ -261,7 +261,6 @@ class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, pr
protected: protected:
QgsSVGFillSymbolLayer* mLayer; QgsSVGFillSymbolLayer* mLayer;
void insertIcons(); void insertIcons();
void updateOutlineIcon();
void updateParamGui(); void updateParamGui();


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


////////// //////////
Expand Down
19 changes: 16 additions & 3 deletions src/ui/symbollayer/widget_ellipse.ui
Expand Up @@ -220,19 +220,32 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1">
<widget class="QComboBox" name="mDDShapeComboBox"/>
</item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QComboBox" name="mDDRotationComboBox"/> <widget class="QComboBox" name="mDDRotationComboBox"/>
</item> </item>
<item row="6" column="1">
<widget class="QComboBox" name="mDDShapeComboBox"/>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="mDDRotationLabel"> <widget class="QLabel" name="mDDRotationLabel">
<property name="text"> <property name="text">
<string>Rotation</string> <string>Rotation</string>
</property> </property>
</widget> </widget>
</item> </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> </layout>
</widget> </widget>
</widget> </widget>
Expand Down
82 changes: 41 additions & 41 deletions src/ui/symbollayer/widget_fontmarker.ui
Expand Up @@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>399</width>
<height>300</height> <height>300</height>
</rect> </rect>
</property> </property>
Expand All @@ -31,20 +31,10 @@
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label_2">
<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">
<property name="text"> <property name="text">
<string>Color</string> <string>Size</string>
</property> </property>
</widget> </widget>
</item> </item>
Expand All @@ -55,17 +45,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label">
<property name="text">
<string>Size</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Rotation</string> <string>Font family</string>
</property> </property>
</widget> </widget>
</item> </item>
Expand All @@ -82,23 +65,6 @@
</property> </property>
</widget> </widget>
</item> </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"> <item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
Expand Down Expand Up @@ -129,6 +95,40 @@
</item> </item>
</layout> </layout>
</item> </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> </layout>
</item> </item>
<item> <item>
Expand Down

0 comments on commit 95f8973

Please sign in to comment.