# CommandBarToggleButton

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/command_bar/struct-commandbartogglebutton/

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

```rust
struct CommandBarToggleButton
```

A toggle button for use in a `CommandBar`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L15)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`label_property`](#function-label_property)
- [`icon_property`](#function-icon_property)
- [`is_compact_property`](#function-is_compact_property)
- [`dynamic_overflow_order_property`](#function-dynamic_overflow_order_property)
- [`label_position_property`](#function-label_position_property)
- [`is_in_overflow_property`](#function-is_in_overflow_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`as_command_bar_element`](#function-as_command_bar_element)
- [`label`](#function-label)
- [`set_label`](#function-set_label)
- [`icon`](#function-icon)
- [`set_icon`](#function-set_icon)
- [`is_compact`](#function-is_compact)
- [`set_is_compact`](#function-set_is_compact)
- [`dynamic_overflow_order`](#function-dynamic_overflow_order)
- [`set_dynamic_overflow_order`](#function-set_dynamic_overflow_order)
- [`label_position`](#function-label_position)
- [`set_label_position`](#function-set_label_position)
- [`is_in_overflow`](#function-is_in_overflow)
- [`set_is_in_overflow`](#function-set_is_in_overflow)

<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/command_bar/command_bar_toggle_button.rs#L19)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L19)

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

### label_property

```rust
fn label_property() -> &'static StyledProperty<Option<String>>
```

Defines the `Label` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L67)

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

### icon_property

```rust
fn icon_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Defines the `Icon` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L67)

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

### is_compact_property

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

Defines the `IsCompact` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L67)

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

### dynamic_overflow_order_property

```rust
fn dynamic_overflow_order_property() -> &'static StyledProperty<i32>
```

Defines the `DynamicOverflowOrder` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L67)

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

### label_position_property

```rust
fn label_position_property() -> &'static StyledProperty<CommandBarDefaultLabelPosition>
```

Defines the `LabelPosition` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L67)

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

### is_in_overflow_property

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

Defines the `IsInOverflow` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L67)

<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/command_bar/command_bar_toggle_button.rs#L103)

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

### new

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

Creates the button.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L108)

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

### as_command_bar_element

```rust
fn as_command_bar_element(self: &Self) -> Rc<dyn ICommandBarElement>
```

The button as a command bar element.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L113)

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

### label

```rust
fn label(self: &Self) -> Option<String>
```

Gets the text label for the button.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L118)

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

### set_label

```rust
fn set_label(self: &Self, value: Option<&str>)
```

Sets the text label for the button.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L123)

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

### icon

```rust
fn icon(self: &Self) -> Option<BoxedValue>
```

Gets the icon content for the button.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L128)

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

### set_icon

```rust
fn set_icon(self: &Self, value: Option<BoxedValue>)
```

Sets the icon content for the button.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L133)

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

### is_compact

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

Gets whether the button is in compact mode (icon only, label
hidden).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L139)

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

### set_is_compact

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

Sets whether the button is in compact mode (icon only, label
hidden).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L145)

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

### dynamic_overflow_order

```rust
fn dynamic_overflow_order(self: &Self) -> i32
```

Gets the order in which this button moves to the overflow menu when
space is limited. Lower values have higher priority (stay visible
longer).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L152)

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

### set_dynamic_overflow_order

```rust
fn set_dynamic_overflow_order(self: &Self, value: i32)
```

Sets the order in which this button moves to the overflow menu when
space is limited.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L158)

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

### label_position

```rust
fn label_position(self: &Self) -> CommandBarDefaultLabelPosition
```

Gets the label position. This is set automatically by the parent
command bar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L164)

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

### set_label_position

```rust
fn set_label_position(self: &Self, value: CommandBarDefaultLabelPosition)
```

Sets the label position. This is set automatically by the parent
command bar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L170)

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

### is_in_overflow

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

Gets whether this button is displayed inside the overflow popup.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L175)

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

### set_is_in_overflow

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

Sets whether this button is displayed inside the overflow popup. Set
automatically by the command bar when moving items between primary
and overflow.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/command_bar/command_bar_toggle_button.rs#L182)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ToggleButtonImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-togglebuttonimplext/)
- [`ContentControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-contentcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`ButtonImplExt`](/docs/0.5.0/api/ferroui-controls/trait-buttonimplext/)
- `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<CommandBarToggleButton>`](/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/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`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/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`ContentControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-contentcontrolimpl/)
- [`ButtonImpl`](/docs/0.5.0/api/ferroui-controls/trait-buttonimpl/)
- [`ToggleButtonImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-togglebuttonimpl/)

## Availability

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