Skip to content

Commit

Permalink
Tweak property definitions for size type properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 5, 2017
1 parent 2c65a66 commit fa8189a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions python/core/qgsproperty.sip
Expand Up @@ -23,6 +23,7 @@ class QgsPropertyDefinition
BlendMode,
Point,
Size,
Size2D,
LineStyle,
FillStyle,
CapStyle,
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.cpp
Expand Up @@ -145,7 +145,7 @@ void QgsPalLayerSettings::initPropertyDefinitions()
{ QgsPalLayerSettings::ShapeRotation, QgsPropertyDefinition( "ShapeRotation", QObject::tr( "Shape rotation" ), QgsPropertyDefinition::Double ) },
{ QgsPalLayerSettings::ShapeOffset, QgsPropertyDefinition( "ShapeOffset", QObject::tr( "Shape offset" ), QgsPropertyDefinition::Offset ) },
{ QgsPalLayerSettings::ShapeOffsetUnits, QgsPropertyDefinition( "ShapeOffsetUnits", QObject::tr( "Shape offset units" ), QgsPropertyDefinition::RenderUnits ) },
{ QgsPalLayerSettings::ShapeRadii, QgsPropertyDefinition( "ShapeRadii", QObject::tr( "Shape radii" ), QgsPropertyDefinition::Size ) },
{ QgsPalLayerSettings::ShapeRadii, QgsPropertyDefinition( "ShapeRadii", QObject::tr( "Shape radii" ), QgsPropertyDefinition::Size2D ) },
{ QgsPalLayerSettings::ShapeRadiiUnits, QgsPropertyDefinition( "ShapeRadiiUnits", QObject::tr( "Symbol radii units" ), QgsPropertyDefinition::RenderUnits ) },
{ QgsPalLayerSettings::ShapeTransparency, QgsPropertyDefinition( "ShapeTransparency", QObject::tr( "Shape transparency" ), QgsPropertyDefinition::Transparency ) },
{ QgsPalLayerSettings::ShapeBlendMode, QgsPropertyDefinition( "ShapeBlendMode", QObject::tr( "Shape blend mode" ), QgsPropertyDefinition::BlendMode ) },
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgsproperty.cpp
Expand Up @@ -112,6 +112,11 @@ QgsPropertyDefinition::QgsPropertyDefinition( const QString& name, const QString
break;

case Size:
mTypes = DataTypeNumeric;
mHelpText = QObject::tr( "double [>= 0.0]" );
break;

case Size2D:
mTypes = DataTypeString;
mHelpText = QObject::tr( "double size [<b>width,height</b>]" );
break;
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsproperty.h
Expand Up @@ -64,7 +64,8 @@ class CORE_EXPORT QgsPropertyDefinition
PenJoinStyle, //!< Pen join style
BlendMode, //!< Blend mode
Point, //!< 2D point
Size, //!< 2D size
Size, //!< 1D size (eg marker radius, or square marker height/width)
Size2D, //!< 2D size (width/height different)
LineStyle, //!< Line style (eg solid/dashed)
FillStyle, //!< Fill style (eg solid, lines)
CapStyle, //!< Line cap style (eg round)
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgssymbollayer.cpp
Expand Up @@ -40,14 +40,14 @@ void QgsSymbolLayer::initPropertyDefinitions()

PROPERTY_DEFINITIONS = QgsPropertiesDefinition
{
{ QgsSymbolLayer::PropertySize, QgsPropertyDefinition( "size", QObject::tr( "Symbol size" ), QgsPropertyDefinition::DoublePositive ) },
{ QgsSymbolLayer::PropertySize, QgsPropertyDefinition( "size", QObject::tr( "Symbol size" ), QgsPropertyDefinition::Size ) },
{ QgsSymbolLayer::PropertyAngle, QgsPropertyDefinition( "angle", QObject::tr( "Rotation angle" ), QgsPropertyDefinition::Double ) },
{ QgsSymbolLayer::PropertyName, QgsPropertyDefinition( "name", QObject::tr( "Symbol name" ), QgsPropertyDefinition::String ) },
{ QgsSymbolLayer::PropertyFillColor, QgsPropertyDefinition( "fillColor", QObject::tr( "Symbol fill color" ), QgsPropertyDefinition::ColorWithAlpha ) },
{ QgsSymbolLayer::PropertyOutlineColor, QgsPropertyDefinition( "outlineColor", QObject::tr( "Symbol outline color" ), QgsPropertyDefinition::ColorWithAlpha ) },
{ QgsSymbolLayer::PropertyOutlineWidth, QgsPropertyDefinition( "outlineWidth", QObject::tr( "Symbol outline width" ), QgsPropertyDefinition::DoublePositive ) },
{ QgsSymbolLayer::PropertyOutlineStyle, QgsPropertyDefinition( "outlineStyle", QObject::tr( "Symbol outline style" ), QgsPropertyDefinition::LineStyle )},
{ QgsSymbolLayer::PropertyOffset, QgsPropertyDefinition( "offset", QObject::tr( "Symbol offset" ), QgsPropertyDefinition::Size )},
{ QgsSymbolLayer::PropertyOffset, QgsPropertyDefinition( "offset", QObject::tr( "Symbol offset" ), QgsPropertyDefinition::Offset )},
{ QgsSymbolLayer::PropertyCharacter, QgsPropertyDefinition( "char", QObject::tr( "Marker character(s)" ), QgsPropertyDefinition::String )},
{ QgsSymbolLayer::PropertyWidth, QgsPropertyDefinition( "width", QObject::tr( "Symbol width" ), QgsPropertyDefinition::DoublePositive )},
{ QgsSymbolLayer::PropertyHeight, QgsPropertyDefinition( "height", QObject::tr( "Symbol height" ), QgsPropertyDefinition::DoublePositive )},
Expand Down

0 comments on commit fa8189a

Please sign in to comment.