FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Popup

    struct · ferroui-controls · v0.5.0

    struct Popup
    

    Displays a popup window.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<Popup>
    

    Returns a strong reference to this object.

    Source

    window_manager_add_shadow_hint_property

    fn window_manager_add_shadow_hint_property() -> &'static StyledProperty<bool>
    

    Defines the WindowManagerAddShadowHint property.

    Source

    child_property

    fn child_property() -> &'static StyledProperty<Option<Ref<Control>>>
    

    Defines the Child property.

    Source

    inherits_transform_property

    fn inherits_transform_property() -> &'static StyledProperty<bool>
    

    Defines the InheritsTransform property.

    Source

    is_open_property

    fn is_open_property() -> &'static StyledProperty<bool>
    

    Defines the IsOpen property.

    Source

    placement_anchor_property

    fn placement_anchor_property() -> &'static StyledProperty<PopupAnchor>
    

    Defines the PlacementAnchor property.

    Source

    placement_constraint_adjustment_property

    fn placement_constraint_adjustment_property() -> &'static StyledProperty<PopupPositionerConstraintAdjustment>
    

    Defines the PlacementConstraintAdjustment property.

    Source

    placement_gravity_property

    fn placement_gravity_property() -> &'static StyledProperty<PopupGravity>
    

    Defines the PlacementGravity property.

    Source

    placement_property

    fn placement_property() -> &'static StyledProperty<PlacementMode>
    

    Defines the Placement property.

    Source

    placement_rect_property

    fn placement_rect_property() -> &'static StyledProperty<Option<Rect>>
    

    Defines the PlacementRect property.

    Source

    placement_target_property

    fn placement_target_property() -> &'static StyledProperty<Option<ElementRef<Control>>>
    

    Defines the PlacementTarget property.

    The popup does not own its placement target (it is usually an ancestor of the popup), so the value is an element reference.

    Source

    custom_popup_placement_callback_property

    fn custom_popup_placement_callback_property() -> &'static StyledProperty<Option<CustomPopupPlacementCallbackValue>>
    

    Defines the CustomPopupPlacementCallback property.

    Source

    overlay_dismiss_event_pass_through_property

    fn overlay_dismiss_event_pass_through_property() -> &'static StyledProperty<bool>
    

    Defines the OverlayDismissEventPassThrough property.

    Source

    overlay_input_pass_through_element_property

    fn overlay_input_pass_through_element_property() -> &'static StyledProperty<Option<ElementRef<InputElement>>>
    

    Defines the OverlayInputPassThroughElement property.

    Source

    horizontal_offset_property

    fn horizontal_offset_property() -> &'static StyledProperty<f64>
    

    Defines the HorizontalOffset property.

    Source

    is_light_dismiss_enabled_property

    fn is_light_dismiss_enabled_property() -> &'static StyledProperty<bool>
    

    Defines the IsLightDismissEnabled property.

    Source

    vertical_offset_property

    fn vertical_offset_property() -> &'static StyledProperty<f64>
    

    Defines the VerticalOffset property.

    Source

    topmost_property

    fn topmost_property() -> &'static StyledProperty<bool>
    

    Defines the Topmost property.

    Source

    takes_focus_from_native_control_property

    fn takes_focus_from_native_control_property() -> &'static AttachedProperty<bool>
    

    Defines the TakesFocusFromNativeControl property.

    Source

    should_use_overlay_layer_property

    fn should_use_overlay_layer_property() -> &'static StyledProperty<bool>
    

    Defines the ShouldUseOverlayLayer property.

    Source

    is_using_overlay_layer_property

    fn is_using_overlay_layer_property() -> &'static DirectProperty<Popup, bool>
    

    Defines the IsUsingOverlayLayer property.

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    closed

    fn closed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Raised when the popup closes.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the popup.

    Source

    opened

    fn opened(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Raised when the popup opens.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the popup.

    Source

    closing

    fn closing(self: &Self, handler: impl Fn(&CancelEventArgs) -> () + 'static) -> Subscription
    

    Raised before the popup closes; the close can be cancelled (internal upstream).

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the popup.

    Source

    popup_host_changed

    fn popup_host_changed(self: &Self, handler: impl Fn(Option<&Rc<dyn IPopupHost>>) -> () + 'static) -> Subscription
    

    Raised when the popup host changes (the popup host provider contract).

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the popup.

    Source

    host

    fn host(self: &Self) -> Option<Rc<dyn IPopupHost>>
    

    The host of the open popup (internal upstream).

    Source

    opened_popups

    fn opened_popups(self: &Self) -> Vec<Ref<Popup>>
    

    The popups that are currently open directly inside this popup, in the order they were opened.

    Source

    window_manager_add_shadow_hint

    fn window_manager_add_shadow_hint(self: &Self) -> bool
    

    A hint to the window manager that a shadow should be added to the popup.

    Source

    set_window_manager_add_shadow_hint

    fn set_window_manager_add_shadow_hint(self: &Self, value: bool)
    

    Source

    child

    fn child(self: &Self) -> Option<Ref<Control>>
    

    The control to display in the popup.

    Source

    set_child

    fn set_child(self: &Self, value: impl Into<Nullable<Control>>)
    

    Source

    dependency_resolver

    fn dependency_resolver(self: &Self) -> Option<Rc<dyn IFerroDependencyResolver>>
    

    A dependency resolver for the PopupRoot.

    This property allows a client to customize the behaviour of the popup by injecting a specialized dependency resolver into the PopupRoot's constructor.

    Source

    set_dependency_resolver

    fn set_dependency_resolver(self: &Self, value: Option<Rc<dyn IFerroDependencyResolver>>)
    

    Source

    inherits_transform

    fn inherits_transform(self: &Self) -> bool
    

    Determines whether the popup inherits the render transform from its placement target. Defaults to false.

    Source

    set_inherits_transform

    fn set_inherits_transform(self: &Self, value: bool)
    

    Source

    is_light_dismiss_enabled

    fn is_light_dismiss_enabled(self: &Self) -> bool
    

    Determines how the popup can be dismissed.

    Light dismiss is when the user taps on any area other than the popup.

    Source

    set_is_light_dismiss_enabled

    fn set_is_light_dismiss_enabled(self: &Self, value: bool)
    

    Source

    is_open

    fn is_open(self: &Self) -> bool
    

    Whether the popup is currently open.

    Source

    set_is_open

    fn set_is_open(self: &Self, value: bool)
    

    Source

    placement_anchor

    fn placement_anchor(self: &Self) -> PopupAnchor
    

    The anchor point on the placement rect when the placement is PlacementMode::AnchorAndGravity.

    Source

    set_placement_anchor

    fn set_placement_anchor(self: &Self, value: PopupAnchor)
    

    Source

    placement_constraint_adjustment

    fn placement_constraint_adjustment(self: &Self) -> PopupPositionerConstraintAdjustment
    

    Describes how the popup position will be adjusted if the unadjusted position would result in the popup being partly constrained.

    Source

    set_placement_constraint_adjustment

    fn set_placement_constraint_adjustment(self: &Self, value: PopupPositionerConstraintAdjustment)
    

    Source

    placement_gravity

    fn placement_gravity(self: &Self) -> PopupGravity
    

    Defines in what direction the popup should open when the placement is PlacementMode::AnchorAndGravity.

    Source

    set_placement_gravity

    fn set_placement_gravity(self: &Self, value: PopupGravity)
    

    Source

    placement

    fn placement(self: &Self) -> PlacementMode
    

    The desired placement of the popup in relation to the placement target.

    Source

    set_placement

    fn set_placement(self: &Self, value: PlacementMode)
    

    Source

    placement_rect

    fn placement_rect(self: &Self) -> Option<Rect>
    

    The anchor rectangle within the parent that the popup will be placed relative to when the placement is PlacementMode::AnchorAndGravity.

    The placement rect defines a rectangle relative to the placement target around which the popup will be opened, with the placement anchor determining which edge of the placement target is used.

    If unset, the anchor rectangle will be the bounds of the placement target.

    Source

    set_placement_rect

    fn set_placement_rect(self: &Self, value: Option<Rect>)
    

    Source

    placement_target

    fn placement_target(self: &Self) -> Option<Ref<Control>>
    

    The control that is used to determine the popup's position.

    Source

    set_placement_target

    fn set_placement_target(self: &Self, value: impl Into<Nullable<Control>>)
    

    Source

    custom_popup_placement_callback

    fn custom_popup_placement_callback(self: &Self) -> Option<CustomPopupPlacementCallback>
    

    The callback that positions the popup when the placement is PlacementMode::Custom.

    Source

    set_custom_popup_placement_callback

    fn set_custom_popup_placement_callback(self: &Self, value: Option<CustomPopupPlacementCallback>)
    

    Source

    overlay_dismiss_event_pass_through

    fn overlay_dismiss_event_pass_through(self: &Self) -> bool
    

    Whether the event that closes the popup is passed through to the parent window.

    When light dismiss is enabled, clicks outside the popup cause the popup to close. When this is false, these clicks will be handled by the popup and not be registered by the parent window. When true, the events will be passed through to the parent window.

    Source

    set_overlay_dismiss_event_pass_through

    fn set_overlay_dismiss_event_pass_through(self: &Self, value: bool)
    

    Source

    overlay_input_pass_through_element

    fn overlay_input_pass_through_element(self: &Self) -> Option<Ref<InputElement>>
    

    An element that should receive pointer input events even when underneath the popup's overlay.

    Source

    set_overlay_input_pass_through_element

    fn set_overlay_input_pass_through_element(self: &Self, value: impl Into<Nullable<InputElement>>)
    

    Source

    horizontal_offset

    fn horizontal_offset(self: &Self) -> f64
    

    The horizontal offset of the popup in relation to the placement target.

    Source

    set_horizontal_offset

    fn set_horizontal_offset(self: &Self, value: f64)
    

    Source

    vertical_offset

    fn vertical_offset(self: &Self) -> f64
    

    The vertical offset of the popup in relation to the placement target.

    Source

    set_vertical_offset

    fn set_vertical_offset(self: &Self, value: f64)
    

    Source

    topmost

    fn topmost(self: &Self) -> bool
    

    Whether this popup appears on top of all other windows.

    Source

    set_topmost

    fn set_topmost(self: &Self, value: bool)
    

    Source

    takes_focus_from_native_control

    fn takes_focus_from_native_control(self: &Self) -> bool
    

    Whether the popup, on show, transfers focus from any focused native control to the toolkit. The default is true.

    This property only applies to advanced native control embedding scenarios. By default, if a popup is shown when a native control is focused, focus is transferred back to the toolkit in order for the popup to receive input. If this property is set to false, then the shown popup will not receive input until it receives an interaction which explicitly focuses the popup, such as a mouse click.

    Source

    set_takes_focus_from_native_control

    fn set_takes_focus_from_native_control(self: &Self, value: bool)
    

    Source

    should_use_overlay_layer

    fn should_use_overlay_layer(self: &Self) -> bool
    

    Whether the popup should be shown in the overlay layer of the parent window.

    When this is false the implementation depends on the platform. Use is_using_overlay_layer to get the actual popup behavior. This is an equivalent of the overlay popups platform option, but settable independently per each popup.

    Source

    set_should_use_overlay_layer

    fn set_should_use_overlay_layer(self: &Self, value: bool)
    

    Source

    is_using_overlay_layer

    fn is_using_overlay_layer(self: &Self) -> bool
    

    Whether the popup is shown in the overlay layer of the parent window.

    Source

    open

    fn open(self: &Self)
    

    Opens the popup.

    Source

    close

    fn close(self: &Self)
    

    Closes the popup.

    Source

    get_takes_focus_from_native_control

    fn get_takes_focus_from_native_control(control: &Control) -> bool
    

    Gets the value of the TakesFocusFromNativeControl attached property on the specified control.

    Source

    set_takes_focus_from_native_control_on

    fn set_takes_focus_from_native_control_on(control: &Control, value: bool)
    

    Sets the value of the TakesFocusFromNativeControl attached property on the specified control.

    Source

    set_popup_parent

    fn set_popup_parent(self: &Self, new_parent: Option<&Ref<Control>>)
    

    Helper method to set popup's styling and templated parent (internal upstream).

    Source

    is_inside_popup

    fn is_inside_popup(self: &Self, visual: &Visual) -> bool
    

    Whether visual is inside the open popup.

    Source

    is_pointer_over_popup

    fn is_pointer_over_popup(self: &Self) -> bool
    

    Whether the pointer is over the open popup.

    Source

    to_popup_host_provider

    fn to_popup_host_provider(self: &Self) -> Rc<dyn IPopupHostProvider>
    

    The popup as a popup host provider (the diagnostics contract it implements upstream).

    Source

    add_opened_popup

    fn add_opened_popup(self: &Self, popup: &Ref<Popup>)
    

    Records a popup opened directly inside this popup (internal upstream).

    Source

    remove_opened_popup

    fn remove_opened_popup(self: &Self, popup: &Ref<Popup>)
    

    Forgets a popup opened directly inside this popup (internal upstream).

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.