# CustomPopupPlacement

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

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

```rust
struct CustomPopupPlacement
```

Defines custom placement parameters for a
`CustomPopupPlacementCallback`
callback.

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

## Members

- [`anchor_rectangle`](#struct_field-anchor_rectangle)
- [`constraint_adjustment`](#struct_field-constraint_adjustment)
- [`offset`](#struct_field-offset)
- [`popup_size`](#function-popup_size)
- [`deflate`](#function-deflate)
- [`target`](#function-target)
- [`anchor`](#function-anchor)
- [`set_anchor`](#function-set_anchor)
- [`gravity`](#function-gravity)
- [`set_gravity`](#function-set_gravity)

<a id="struct_field-anchor_rectangle"></a>

### anchor_rectangle

```rust
anchor_rectangle: ferroui_base::Rect
```

See `PopupPositionerParameters::anchor_rectangle`.

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

<a id="struct_field-constraint_adjustment"></a>

### constraint_adjustment

```rust
constraint_adjustment: super::PopupPositionerConstraintAdjustment
```

See `PopupPositionerParameters::constraint_adjustment`.

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

<a id="struct_field-offset"></a>

### offset

```rust
offset: ferroui_base::Point
```

See `PopupPositionerParameters::offset`.

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

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

### popup_size

```rust
fn popup_size(self: &Self) -> Size
```

The `Size` of the popup control.

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

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

### deflate

```rust
fn deflate(self: &Self) -> Thickness
```

Gets how far to deflate `popup_size` when
positioning the popup.

This is normally set to the margin of the popup's child. This allows
out-of-bounds effects like drop shadows to be drawn without affecting
the final position of the child.

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

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

### target

```rust
fn target(self: &Self) -> Ref<Visual>
```

Placement target of the popup.

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

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

### anchor

```rust
fn anchor(self: &Self) -> PopupAnchor
```

See `PopupPositionerParameters::anchor`.

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

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

### set_anchor

```rust
fn set_anchor(self: &mut Self, value: PopupAnchor)
```

See `PopupPositionerParameters::set_anchor`.
## Panics

Panics when opposite edges are specified.

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

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

### gravity

```rust
fn gravity(self: &Self) -> PopupGravity
```

See `PopupPositionerParameters::gravity`.

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

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

### set_gravity

```rust
fn set_gravity(self: &mut Self, value: PopupGravity)
```

See `PopupPositionerParameters::set_gravity`.
## Panics

Panics when opposite edges are specified.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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