Skip to main content

DraggableControlStyle

export class DraggableControlStyle {
width: Float? = nil
height: Float? = nil
image: ImageAsset = default_knob_image
handle_size: Float = 0.0
padding: EdgeInsets = EdgeInsets(0.0)
label_style: LabelStyle = LabelStyle()
axis: Axis = Axis.vertical
disabled_opacity: Float = 0.24

copy() -> (DraggableControlStyle)
deep_copy() -> (DraggableControlStyle)
overriding(_ modify: (DraggableControlStyle) -> ()) -> (DraggableControlStyle)
}

Properties

width: Float? = nil

Controls the width of the slider. When set to nil, defaults to the image's width.

height: Float? = nil

Controls the height of the slider. When set to nil, defaults to the image's height.

image: ImageAsset = default_knob_image

The image to display.

See ImageAsset.

handle_size: Float = 0.0

Handle size in the dragging axis direction.

padding: EdgeInsets = EdgeInsets(0)

The padding area to add around the image to increase the interactive area.

See EdgeInsets.

label_style: LabelStyle = LabelStyle()

Customizes the label appearance.

See LabelStyle.

axis: Axis = Axis.vertical

On which axis the control operates.

See Axis.

disabled_opacity: Float = 0.24

The opacity to apply to the control when disabled.

Methods

copy() -> (DraggableControlStyle)

Returns a shallow copy (nested reference objects aren't copied).

deep_copy() -> (DraggableControlStyle)

Returns a deep copy (includes copying nested reference objects).

overriding(_ modify: (DraggableControlStyle) -> ()) -> (DraggableControlStyle)

Returns a modified copy of the style. Modify the copy inside the modify function.

Returns a modified copy of the style. Modify the copy inside the modify funtion.

var modified = (DraggableControlStyle()).overriding(fun (style) {
style.axis = Axis.horizontal
})