# Track

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/primitives/struct-track/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct Track
```

A control that positions a [`Thumb`](/docs/0.5.0/api/ferroui-controls/primitives/struct-thumb/) and the buttons before and after it
along a range: the building block of scroll bars and sliders.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L24)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`value_from_point`](#function-value_from_point)
- [`value_from_distance`](#function-value_from_distance)
- [`PSEUDO_CLASSES`](#assoc_const-pseudo_classes)
- [`minimum_property`](#function-minimum_property)
- [`maximum_property`](#function-maximum_property)
- [`value_property`](#function-value_property)
- [`viewport_size_property`](#function-viewport_size_property)
- [`orientation_property`](#function-orientation_property)
- [`thumb_property`](#function-thumb_property)
- [`increase_button_property`](#function-increase_button_property)
- [`decrease_button_property`](#function-decrease_button_property)
- [`is_direction_reversed_property`](#function-is_direction_reversed_property)
- [`ignore_thumb_drag_property`](#function-ignore_thumb_drag_property)
- [`defer_thumb_drag_property`](#function-defer_thumb_drag_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`minimum`](#function-minimum)
- [`set_minimum`](#function-set_minimum)
- [`maximum`](#function-maximum)
- [`set_maximum`](#function-set_maximum)
- [`value`](#function-value)
- [`set_range_value`](#function-set_range_value)
- [`viewport_size`](#function-viewport_size)
- [`set_viewport_size`](#function-set_viewport_size)
- [`orientation`](#function-orientation)
- [`set_orientation`](#function-set_orientation)
- [`thumb`](#function-thumb)
- [`set_thumb`](#function-set_thumb)
- [`increase_button`](#function-increase_button)
- [`set_increase_button`](#function-set_increase_button)
- [`decrease_button`](#function-decrease_button)
- [`set_decrease_button`](#function-set_decrease_button)
- [`is_direction_reversed`](#function-is_direction_reversed)
- [`set_is_direction_reversed`](#function-set_is_direction_reversed)
- [`ignore_thumb_drag`](#function-ignore_thumb_drag)
- [`set_ignore_thumb_drag`](#function-set_ignore_thumb_drag)
- [`defer_thumb_drag`](#function-defer_thumb_drag)
- [`set_defer_thumb_drag`](#function-set_defer_thumb_drag)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L34)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<Track>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L34)

<a id="function-value_from_point"></a>

### value_from_point

```rust
fn value_from_point(self: &Self, point: Point) -> f64
```

Calculates the distance along the thumb of a specified point
along the track.

Returns the distance between the thumb and the specified point
value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L34)

<a id="function-value_from_distance"></a>

### value_from_distance

```rust
fn value_from_distance(self: &Self, horizontal: f64, vertical: f64) -> f64
```

Calculates the change in the value of the track when the thumb
moves by the given horizontal and vertical displacement.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L34)

<a id="assoc_const-pseudo_classes"></a>

### PSEUDO_CLASSES

```rust
const PSEUDO_CLASSES: PseudoClassesAttribute
```

The pseudoclasses set by the class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L218)

<a id="function-minimum_property"></a>

### minimum_property

```rust
fn minimum_property() -> &'static StyledProperty<f64>
```

Defines the `Minimum` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-maximum_property"></a>

### maximum_property

```rust
fn maximum_property() -> &'static StyledProperty<f64>
```

Defines the `Maximum` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-value_property"></a>

### value_property

```rust
fn value_property() -> &'static StyledProperty<f64>
```

Defines the `Value` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-viewport_size_property"></a>

### viewport_size_property

```rust
fn viewport_size_property() -> &'static StyledProperty<f64>
```

Defines the `ViewportSize` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-orientation_property"></a>

### orientation_property

```rust
fn orientation_property() -> &'static StyledProperty<Orientation>
```

Defines the `Orientation` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-thumb_property"></a>

### thumb_property

```rust
fn thumb_property() -> &'static StyledProperty<Option<Ref<Thumb>>>
```

Defines the `Thumb` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-increase_button_property"></a>

### increase_button_property

```rust
fn increase_button_property() -> &'static StyledProperty<Option<Ref<Button>>>
```

Defines the `IncreaseButton` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-decrease_button_property"></a>

### decrease_button_property

```rust
fn decrease_button_property() -> &'static StyledProperty<Option<Ref<Button>>>
```

Defines the `DecreaseButton` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-is_direction_reversed_property"></a>

### is_direction_reversed_property

```rust
fn is_direction_reversed_property() -> &'static StyledProperty<bool>
```

Defines the `IsDirectionReversed` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-ignore_thumb_drag_property"></a>

### ignore_thumb_drag_property

```rust
fn ignore_thumb_drag_property() -> &'static StyledProperty<bool>
```

Defines the `IgnoreThumbDrag` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-defer_thumb_drag_property"></a>

### defer_thumb_drag_property

```rust
fn defer_thumb_drag_property() -> &'static StyledProperty<bool>
```

Defines the `DeferThumbDrag` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L221)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L315)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L327)

<a id="function-minimum"></a>

### minimum

```rust
fn minimum(self: &Self) -> f64
```

The minimum possible value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L332)

<a id="function-set_minimum"></a>

### set_minimum

```rust
fn set_minimum(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L336)

<a id="function-maximum"></a>

### maximum

```rust
fn maximum(self: &Self) -> f64
```

The maximum possible value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L341)

<a id="function-set_maximum"></a>

### set_maximum

```rust
fn set_maximum(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L345)

<a id="function-value"></a>

### value

```rust
fn value(self: &Self) -> f64
```

The current value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L350)

<a id="function-set_range_value"></a>

### set_range_value

```rust
fn set_range_value(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L354)

<a id="function-viewport_size"></a>

### viewport_size

```rust
fn viewport_size(self: &Self) -> f64
```

The amount of the scrollable content that is currently visible.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L369)

<a id="function-set_viewport_size"></a>

### set_viewport_size

```rust
fn set_viewport_size(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L373)

<a id="function-orientation"></a>

### orientation

```rust
fn orientation(self: &Self) -> Orientation
```

The orientation of the track.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L378)

<a id="function-set_orientation"></a>

### set_orientation

```rust
fn set_orientation(self: &Self, value: Orientation)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L382)

<a id="function-thumb"></a>

### thumb

```rust
fn thumb(self: &Self) -> Option<Ref<Thumb>>
```

The thumb of the track: its content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L387)

<a id="function-set_thumb"></a>

### set_thumb

```rust
fn set_thumb(self: &Self, value: impl Into<Nullable<Thumb>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L391)

<a id="function-increase_button"></a>

### increase_button

```rust
fn increase_button(self: &Self) -> Option<Ref<Button>>
```

The button that increases the value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L396)

<a id="function-set_increase_button"></a>

### set_increase_button

```rust
fn set_increase_button(self: &Self, value: impl Into<Nullable<Button>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L400)

<a id="function-decrease_button"></a>

### decrease_button

```rust
fn decrease_button(self: &Self) -> Option<Ref<Button>>
```

The button that decreases the value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L405)

<a id="function-set_decrease_button"></a>

### set_decrease_button

```rust
fn set_decrease_button(self: &Self, value: impl Into<Nullable<Button>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L409)

<a id="function-is_direction_reversed"></a>

### is_direction_reversed

```rust
fn is_direction_reversed(self: &Self) -> bool
```

Whether the direction of increasing value is reversed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L414)

<a id="function-set_is_direction_reversed"></a>

### set_is_direction_reversed

```rust
fn set_is_direction_reversed(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L418)

<a id="function-ignore_thumb_drag"></a>

### ignore_thumb_drag

```rust
fn ignore_thumb_drag(self: &Self) -> bool
```

Whether drags of the thumb are ignored.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L423)

<a id="function-set_ignore_thumb_drag"></a>

### set_ignore_thumb_drag

```rust
fn set_ignore_thumb_drag(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L427)

<a id="function-defer_thumb_drag"></a>

### defer_thumb_drag

```rust
fn defer_thumb_drag(self: &Self) -> bool
```

Whether the value is only updated when a drag of the thumb completes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L432)

<a id="function-set_defer_thumb_drag"></a>

### set_defer_thumb_drag

```rust
fn set_defer_thumb_drag(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/track.rs#L436)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TrackImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-trackimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Track>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`TrackImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-trackimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
