Skip to content
Permalink
Browse files

removed color/width from line pattern fill symbol layer widget, fixes…

… partially #8975
  • Loading branch information
blazek committed Jan 24, 2014
1 parent 5222905 commit 95c3c6ff2988c03977cdd4fbd37bf02cd0ee9704
@@ -1408,6 +1408,18 @@ QgsLinePatternFillSymbolLayer::QgsLinePatternFillSymbolLayer(): QgsImageFillSymb
QgsImageFillSymbolLayer::setSubSymbol( 0 ); //no outline
}

void QgsLinePatternFillSymbolLayer::setLineWidth( double w )
{
mFillLineSymbol->setWidth( w );
mLineWidth = w;
}

void QgsLinePatternFillSymbolLayer::setColor( const QColor& c )
{
mFillLineSymbol->setColor( c );
mColor = c;
}

QgsLinePatternFillSymbolLayer::~QgsLinePatternFillSymbolLayer()
{
delete mFillLineSymbol;
@@ -416,9 +416,9 @@ class CORE_EXPORT QgsLinePatternFillSymbolLayer: public QgsImageFillSymbolLayer
double lineAngle() const { return mLineAngle; }
void setDistance( double d ) { mDistance = d; }
double distance() const { return mDistance; }
void setLineWidth( double w ) { mLineWidth = w; }
void setLineWidth( double w );
double lineWidth() const { return mLineWidth; }
void setColor( const QColor& c ) { mColor = c; }
void setColor( const QColor& c );
QColor color() const { return mColor; }
void setOffset( double offset ) { mOffset = offset; }
double offset() const { return mOffset; }
@@ -1892,18 +1892,12 @@ void QgsLinePatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* laye
mLayer = patternLayer;
mAngleSpinBox->setValue( mLayer->lineAngle() );
mDistanceSpinBox->setValue( mLayer->distance() );
mLineWidthSpinBox->setValue( mLayer->lineWidth() );
mOffsetSpinBox->setValue( mLayer->offset() );
mColorPushButton->setColor( mLayer->color() );
mColorPushButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );

//units
mDistanceUnitComboBox->blockSignals( true );
mDistanceUnitComboBox->setCurrentIndex( mLayer->distanceUnit() );
mDistanceUnitComboBox->blockSignals( false );
mLineWidthUnitComboBox->blockSignals( true );
mLineWidthUnitComboBox->setCurrentIndex( mLayer->lineWidthUnit() );
mLineWidthUnitComboBox->blockSignals( false );
mOffsetUnitComboBox->blockSignals( true );
mOffsetUnitComboBox->setCurrentIndex( mLayer->offsetUnit() );
mOffsetUnitComboBox->blockSignals( false );
@@ -1933,15 +1927,6 @@ void QgsLinePatternFillSymbolLayerWidget::on_mDistanceSpinBox_valueChanged( doub
}
}

void QgsLinePatternFillSymbolLayerWidget::on_mLineWidthSpinBox_valueChanged( double d )
{
if ( mLayer )
{
mLayer->setLineWidth( d );
emit changed();
}
}

void QgsLinePatternFillSymbolLayerWidget::on_mOffsetSpinBox_valueChanged( double d )
{
if ( mLayer )
@@ -1951,17 +1936,6 @@ void QgsLinePatternFillSymbolLayerWidget::on_mOffsetSpinBox_valueChanged( double
}
}

void QgsLinePatternFillSymbolLayerWidget::on_mColorPushButton_colorChanged( const QColor& color )
{
if ( !mLayer )
{
return;
}

mLayer->setColor( color );
emit changed();
}

void QgsLinePatternFillSymbolLayerWidget::on_mDistanceUnitComboBox_currentIndexChanged( int index )
{
if ( mLayer )
@@ -1971,15 +1945,6 @@ void QgsLinePatternFillSymbolLayerWidget::on_mDistanceUnitComboBox_currentIndexC
}
}

void QgsLinePatternFillSymbolLayerWidget::on_mLineWidthUnitComboBox_currentIndexChanged( int index )
{
if ( mLayer )
{
mLayer->setLineWidthUnit(( QgsSymbolV2::OutputUnit ) index );
emit changed();
}
}

void QgsLinePatternFillSymbolLayerWidget::on_mOffsetUnitComboBox_currentIndexChanged( int index )
{
if ( mLayer )
@@ -340,11 +340,8 @@ class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Wi
private slots:
void on_mAngleSpinBox_valueChanged( double d );
void on_mDistanceSpinBox_valueChanged( double d );
void on_mLineWidthSpinBox_valueChanged( double d );
void on_mOffsetSpinBox_valueChanged( double d );
void on_mColorPushButton_colorChanged( const QColor& color );
void on_mDistanceUnitComboBox_currentIndexChanged( int index );
void on_mLineWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mDataDefinedPropertiesButton_clicked();
};
@@ -85,57 +85,13 @@
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mLineWidthLabel">
<property name="text">
<string>Line width</string>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QDoubleSpinBox" name="mLineWidthSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>99999999.000000000000000</double>
</property>
<property name="singleStep">
<double>0.200000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mLineWidthUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mOffsetLabel">
<property name="text">
<string>Offset</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QDoubleSpinBox" name="mOffsetSpinBox">
@@ -175,33 +131,7 @@
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="mColorLabel">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QgsColorButton" name="mColorPushButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="QPushButton" name="mDataDefinedPropertiesButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@@ -216,13 +146,6 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsColorButton</class>
<extends>QPushButton</extends>
<header>qgscolorbutton.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

0 comments on commit 95c3c6f

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