Skip to content

Commit

Permalink
Unify behaviour of more rotation controls
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 30, 2017
1 parent 21a4ac4 commit 0e53226
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 52 deletions.
9 changes: 9 additions & 0 deletions src/gui/symbology-ng/qgssymbollayerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ QgsSimpleMarkerSymbolLayerWidget::QgsSimpleMarkerSymbolLayerWidget( const QgsVec

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
spinAngle->setClearValue( 0.0 );

//make a temporary symbol for the size assistant preview
mAssistantPreviewSymbol.reset( new QgsMarkerSymbol() );
Expand Down Expand Up @@ -803,6 +804,7 @@ QgsFilledMarkerSymbolLayerWidget::QgsFilledMarkerSymbolLayerWidget( const QgsVec

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
spinAngle->setClearValue( 0.0 );

//make a temporary symbol for the size assistant preview
mAssistantPreviewSymbol.reset( new QgsMarkerSymbol() );
Expand Down Expand Up @@ -987,6 +989,7 @@ QgsGradientFillSymbolLayerWidget::QgsGradientFillSymbolLayerWidget( const QgsVec

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
mSpinAngle->setClearValue( 0.0 );

connect( btnChangeColor, &QgsColorButton::colorChanged, this, &QgsGradientFillSymbolLayerWidget::setColor );
connect( btnChangeColor2, &QgsColorButton::colorChanged, this, &QgsGradientFillSymbolLayerWidget::setColor2 );
Expand Down Expand Up @@ -1735,6 +1738,7 @@ QgsSvgMarkerSymbolLayerWidget::QgsSvgMarkerSymbolLayerWidget( const QgsVectorLay

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
spinAngle->setClearValue( 0.0 );

populateList();

Expand Down Expand Up @@ -2114,6 +2118,8 @@ QgsSVGFillSymbolLayerWidget::QgsSVGFillSymbolLayerWidget( const QgsVectorLayer *
mSvgTreeView->setHeaderHidden( true );
insertIcons();

mRotationSpinBox->setClearValue( 0.0 );

mChangeColorButton->setColorDialogTitle( tr( "Select fill color" ) );
mChangeColorButton->setContext( QStringLiteral( "symbology" ) );
mChangeStrokeColorButton->setColorDialogTitle( tr( "Select stroke color" ) );
Expand Down Expand Up @@ -2399,6 +2405,7 @@ QgsLinePatternFillSymbolLayerWidget::QgsLinePatternFillSymbolLayerWidget( const
mOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mOffsetSpinBox->setClearValue( 0 );
mAngleSpinBox->setClearValue( 0 );
}

void QgsLinePatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayer *layer )
Expand Down Expand Up @@ -2657,6 +2664,7 @@ QgsFontMarkerSymbolLayerWidget::QgsFontMarkerSymbolLayerWidget( const QgsVectorL

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
spinAngle->setClearValue( 0.0 );

//make a temporary symbol for the size assistant preview
mAssistantPreviewSymbol.reset( new QgsMarkerSymbol() );
Expand Down Expand Up @@ -2918,6 +2926,7 @@ QgsRasterFillSymbolLayerWidget::QgsRasterFillSymbolLayerWidget( const QgsVectorL

mSpinOffsetX->setClearValue( 0.0 );
mSpinOffsetY->setClearValue( 0.0 );
mRotationSpinBox->setClearValue( 0.0 );

connect( cboCoordinateMode, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
connect( mSpinOffsetX, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
Expand Down
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgssymbolslistwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ QgsSymbolsListWidget::QgsSymbolsListWidget( QgsSymbol *symbol, QgsStyle *style,
, mMapCanvas( nullptr )
{
setupUi( this );
spinAngle->setClearValue( 0 );

mSymbolUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
Expand Down
7 changes: 5 additions & 2 deletions src/ui/qgstextformatwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -3409,14 +3409,17 @@ font-style: italic;</string>
</item>
<item>
<widget class="QgsSpinBox" name="mShadowOffsetAngleSpnBx">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string>˚</string>
</property>
<property name="minimum">
<number>-180</number>
<number>-360</number>
</property>
<property name="maximum">
<number>180</number>
<number>360</number>
</property>
<property name="showClearButton" stdset="0">
<bool>false</bool>
Expand Down
15 changes: 9 additions & 6 deletions src/ui/symbollayer/widget_ellipse.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>305</width>
<width>334</width>
<height>680</height>
</rect>
</property>
Expand Down Expand Up @@ -228,6 +228,9 @@
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QgsDoubleSpinBox" name="mRotationSpinBox">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string> °</string>
</property>
Expand Down Expand Up @@ -599,17 +602,17 @@
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsPenJoinStyleComboBox</class>
<extends>QComboBox</extends>
<header>qgspenstylecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsUnitSelectionWidget</class>
<extends>QWidget</extends>
<header>qgsunitselectionwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsPenJoinStyleComboBox</class>
<extends>QComboBox</extends>
<header>qgspenstylecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsPenStyleComboBox</class>
<extends>QComboBox</extends>
Expand Down
6 changes: 6 additions & 0 deletions src/ui/symbollayer/widget_filledmarker.ui
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,18 @@
</item>
<item row="1" column="1">
<widget class="QgsDoubleSpinBox" name="spinAngle">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string> °</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
Expand Down
28 changes: 17 additions & 11 deletions src/ui/symbollayer/widget_fontmarker.ui
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,18 @@
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QgsDoubleSpinBox" name="spinAngle">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string> °</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
Expand Down Expand Up @@ -453,33 +459,33 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsPropertyOverrideButton</class>
<extends>QToolButton</extends>
<header>qgspropertyoverridebutton.h</header>
</customwidget>
<customwidget>
<class>QgsDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsPenJoinStyleComboBox</class>
<extends>QComboBox</extends>
<header>qgspenstylecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsUnitSelectionWidget</class>
<extends>QWidget</extends>
Expand Down
23 changes: 17 additions & 6 deletions src/ui/symbollayer/widget_gradientfill.ui
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,15 @@
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QgsDoubleSpinBox" name="mSpinAngle">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string> °</string>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
Expand Down Expand Up @@ -517,6 +523,11 @@
</spacer>
</item>
</layout>
<zorder>btnChangeColor2</zorder>
<zorder>btnColorRamp</zorder>
<zorder>btnChangeColor</zorder>
<zorder>checkRefPoint1Centroid</zorder>
<zorder>checkRefPoint2Centroid</zorder>
<zorder>label_6</zorder>
<zorder>label_3</zorder>
<zorder>radioColorRamp</zorder>
Expand Down Expand Up @@ -546,12 +557,6 @@
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorRampButton</class>
<extends>QToolButton</extends>
<header>qgscolorrampbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsPropertyOverrideButton</class>
<extends>QToolButton</extends>
Expand All @@ -568,6 +573,12 @@
<header>qgsunitselectionwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorRampButton</class>
<extends>QToolButton</extends>
<header>qgscolorrampbutton.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>radioTwoColor</tabstop>
Expand Down
6 changes: 6 additions & 0 deletions src/ui/symbollayer/widget_linepatternfill.ui
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,15 @@
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QgsDoubleSpinBox" name="mAngleSpinBox">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string> °</string>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
Expand Down
6 changes: 6 additions & 0 deletions src/ui/symbollayer/widget_rasterfill.ui
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string> °</string>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
Expand Down
18 changes: 12 additions & 6 deletions src/ui/symbollayer/widget_simplemarker.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>305</width>
<width>318</width>
<height>637</height>
</rect>
</property>
Expand Down Expand Up @@ -121,12 +121,18 @@
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QgsDoubleSpinBox" name="spinAngle">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string> °</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
Expand Down Expand Up @@ -535,17 +541,17 @@
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsPenJoinStyleComboBox</class>
<extends>QComboBox</extends>
<header>qgspenstylecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsUnitSelectionWidget</class>
<extends>QWidget</extends>
<header>qgsunitselectionwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsPenJoinStyleComboBox</class>
<extends>QComboBox</extends>
<header>qgspenstylecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsPenStyleComboBox</class>
<extends>QComboBox</extends>
Expand Down
Loading

0 comments on commit 0e53226

Please sign in to comment.