Skip to content

Commit

Permalink
Update more rotation widgets to standard behavior, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 31, 2017
1 parent f83d2f4 commit c019314
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/gui/effects/qgspainteffectwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ QgsShadowEffectWidget::QgsShadowEffectWidget( QWidget *parent )
mShadowColorBtn->setAllowOpacity( false );
mShadowColorBtn->setColorDialogTitle( tr( "Select shadow color" ) );
mShadowColorBtn->setContext( QStringLiteral( "symbology" ) );
mShadowOffsetAngleSpnBx->setClearValue( 0 );

mOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderMapUnits
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
Expand Down
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgs25drendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Qgs25DRendererWidget::Qgs25DRendererWidget( QgsVectorLayer *layer, QgsStyle *sty
setupUi( this );
this->layout()->setContentsMargins( 0, 0, 0, 0 );

mAngleWidget->setClearValue( 0 );
mWallColorButton->setColorDialogTitle( tr( "Select wall color" ) );
mWallColorButton->setAllowOpacity( true );
mWallColorButton->setContext( QStringLiteral( "symbology" ) );
Expand Down
17 changes: 10 additions & 7 deletions src/ui/effects/widget_shadoweffect.ui
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,17 @@
</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 Expand Up @@ -249,11 +252,6 @@
<extends>QComboBox</extends>
<header>qgsblendmodecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsEffectDrawModeComboBox</class>
<extends>QComboBox</extends>
<header>qgseffectdrawmodecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsUnitSelectionWidget</class>
<extends>QWidget</extends>
Expand All @@ -266,6 +264,11 @@
<header>qgsopacitywidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsEffectDrawModeComboBox</class>
<extends>QComboBox</extends>
<header>qgseffectdrawmodecombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mShadowOffsetAngleDial</tabstop>
Expand Down
1 change: 0 additions & 1 deletion src/ui/qgstextformatwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6572,7 +6572,6 @@ font-style: italic;</string>
<tabstop>mPointOffsetUnitWidget</tabstop>
<tabstop>mPointOffsetUnitsDDBtn</tabstop>
<tabstop>mPointAngleSpinBox</tabstop>
<tabstop>mPointAngleDDBtn</tabstop>
<tabstop>mRepeatDistanceSpinBox</tabstop>
<tabstop>mRepeatDistanceDDBtn</tabstop>
<tabstop>mRepeatDistanceUnitWidget</tabstop>
Expand Down
10 changes: 8 additions & 2 deletions src/ui/raster/qgshillshaderendererwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,24 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string>˚</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Altitude (degrees)</string>
<string>Altitude</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Azimuth (degrees)</string>
<string>Azimuth</string>
</property>
</widget>
</item>
Expand All @@ -91,6 +94,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string>˚</string>
</property>
<property name="singleStep">
<double>5.000000000000000</double>
</property>
Expand Down
25 changes: 18 additions & 7 deletions src/ui/symbollayer/qgs25drendererwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,16 @@
<widget class="QgsFieldExpressionWidget" name="mHeightWidget" native="true"/>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="mAngleWidget">
<widget class="QgsSpinBox" name="mAngleWidget">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="minimum">
<number>-360</number>
</property>
<property name="maximum">
<number>359</number>
</property>
Expand All @@ -137,18 +143,23 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsFieldExpressionWidget</class>
<extends>QWidget</extends>
<header location="global">qgsfieldexpressionwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsSpinBox</class>
<extends>QSpinBox</extends>
<header>qgsspinbox.h</header>
</customwidget>
<customwidget>
<class>QgsFieldExpressionWidget</class>
<extends>QWidget</extends>
<header>qgsfieldexpressionwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
Expand Down
24 changes: 12 additions & 12 deletions tests/src/core/testqgsdiagram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 5, 5 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsLinearlyInterpolatedDiagramRenderer *dr = new QgsLinearlyInterpolatedDiagramRenderer();
dr->setLowerValue( 0.0 );
Expand Down Expand Up @@ -190,7 +190,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 5, 5 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsLinearlyInterpolatedDiagramRenderer *dr = new QgsLinearlyInterpolatedDiagramRenderer();
dr->setLowerValue( 0.0 );
Expand Down Expand Up @@ -232,7 +232,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
Expand Down Expand Up @@ -269,7 +269,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
Expand Down Expand Up @@ -306,7 +306,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
Expand All @@ -318,7 +318,7 @@ class TestQgsDiagram : public QObject
dls.setShowAllDiagrams( true );

//setup data defined start angle
dls.dataDefinedProperties().setProperty( QgsDiagramLayerSettings::StartAngle, QgsProperty::fromExpression( "\"Importance\"/20.0 * 360.0", true ) );
dls.dataDefinedProperties().setProperty( QgsDiagramLayerSettings::StartAngle, QgsProperty::fromExpression( "360.0-\"Importance\"/20.0 * 360.0", true ) );

mPointsLayer->setDiagramLayerSettings( dls );

Expand All @@ -342,7 +342,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
Expand Down Expand Up @@ -378,7 +378,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
Expand Down Expand Up @@ -414,7 +414,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 50, 50 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
Expand Down Expand Up @@ -448,7 +448,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 50, 50 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
Expand Down Expand Up @@ -484,7 +484,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 50, 50 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
Expand Down Expand Up @@ -525,7 +525,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsTextDiagram() );
Expand Down

0 comments on commit c019314

Please sign in to comment.