The UbuntuShape is a rounded rectangle (based on a squircle ) containing an optional source image blended over a background color (solid or linear gradient). Different properties allow to change the look of the shape.

This property defines a radius relative to the size of the UbuntuShape. It is specified as a number between 0.0 (0%) and 0.75 (75%) corresponding to the proportion of the radius with regards to the smallest side (divided by 2 since a side has 2 angles). The default value is 0.0.

This property sets the source provider of a texture rendered in the UbuntuShape. Supported types are Image, AnimatedImage (to render a GIF image for instance) and ShaderEffectSource (to embed a UI previously rendered with QML). It is blended over the background color. The default value is null.

Note: Setting this disables support for the deprecated image property.

UbuntuShape.Stretch - the source is scaled non-uniformly to fit

UbuntuShape.PreserveAspectFit - the source is scaled uniformly to fit without cropping

UbuntuShape.PreserveAspectCrop - the source is scaled uniformly to fit with cropping

UbuntuShape.Pad - the source is not scaled

This QML property was introduced in Ubuntu.Components 1.2.

sourceHorizontalAlignment : enumeration

This property defines how the source texture is horizontally aligned inside the UbuntuShape area. The default value is UbuntuShape.AlignLeft.

Note: Setting this disables support for the deprecated image property.

UbuntuShape.AlignLeft - the source is aligned to the left

UbuntuShape.AlignHCenter - the source is aligned to the horizontal center

UbuntuShape.AlignRight - the source is aligned to the right

This QML property was introduced in Ubuntu.Components 1.2.

sourceHorizontalWrapMode : enumeration

When the sourceFillMode is set to UbuntuShape.Pad or UbuntuShape.PreserveAspectFit or when the sourceScale and/or sourceTranslation properties are changed, the source texture might not cover the entire UbuntuShape area. This property defines how the source texture wraps outside of its content area. The default value is UbuntuShape.Transparent.

Ensure UbuntuShape.Repeat is used only when necessary (in case of an Image or AnimatedImage source) as it requires the underlying texture to be extracted from its atlas. That slows down the rendering speed since it prevents the QtQuick renderer to batch the UbuntuShape with others.

Note: Some OpenGL ES 2 implementations do not support UbuntuShape.Repeat with non-power-of-two sized source textures.

Note: Setting this disables support for the deprecated image property.

UbuntuShape.Transparent - the source is clamped to transparent

UbuntuShape.Repeat - the source is repeated indefinitely

This QML property was introduced in Ubuntu.Components 1.2.

sourceOpacity : real

This property holds the opacity of the source texture. Opacity is specified as a number between 0.0 (fully transparent) and 1.0 (fully opaque). The default value is 1.0.

Note: Setting this disables support for the deprecated image property.

This property defines the two-component vector in normalized item coordinates used to translate the source texture. The default value is Qt.vector2d(0.0,0.0).

That can be used to put the source texture at a precise position, to create infinite scrolling animations (using the UbuntuShape.Repeat wrap mode), etc.

Note: Setting this disables support for the deprecated image property.

This QML property was introduced in Ubuntu.Components 1.2.

sourceVerticalAlignment : enumeration

This property defines how the source texture is vertically aligned inside the UbuntuShape area. The default value is UbuntuShape.AlignTop.

Note: Setting this disables support for the deprecated image property.

UbuntuShape.AlignTop - the source is aligned to the top

UbuntuShape.AlignVCenter - the source is aligned to the vertical center

UbuntuShape.AlignBottom - the source is aligned to the bottom

This QML property was introduced in Ubuntu.Components 1.2.

sourceVerticalWrapMode : enumeration

When the sourceFillMode is set to UbuntuShape.Pad or UbuntuShape.PreserveAspectFit or when the sourceScale and/or sourceTranslation properties are changed, the source texture might not cover the entire UbuntuShape area. This property defines how the source texture wraps outside of its content area. The default value is UbuntuShape.Transparent.

Ensure UbuntuShape.Repeat is used only when necessary (in case of an Image or AnimatedImage source) as it requires the underlying texture to be extracted from its atlas. That slows down the rendering speed since it prevents the QtQuick renderer to batch the UbuntuShape with others.

Note: Some OpenGL ES 2 implementations do not support UbuntuShape.Repeat with non-power-of-two sized source textures.

Note: Setting this disables support for the deprecated image property.