Trait rat_focus::HasFocusFlag

source ·
pub trait HasFocusFlag {
    // Required methods
    fn focus(&self) -> &FocusFlag;
    fn area(&self) -> Rect;

    // Provided methods
    fn z_areas(&self) -> &[ZRect] { ... }
    fn navigable(&self) -> bool { ... }
    fn is_focused(&self) -> bool { ... }
    fn lost_focus(&self) -> bool { ... }
    fn gained_focus(&self) -> bool { ... }
}
Expand description

Trait for a widget that has a focus flag.

Required Methods§

source

fn focus(&self) -> &FocusFlag

Access to the flag for the rest.

source

fn area(&self) -> Rect

Access the area for mouse focus.

Provided Methods§

source

fn z_areas(&self) -> &[ZRect]

The widget might have several disjointed areas. This is the case if it is showing a popup, but there might be other causes.

This is seen as a higher resolution image of the area given with area(). That means the result of area() is the union of all areas given here.

source

fn navigable(&self) -> bool

The widget is focusable, but doesn’t want to partake in keyboard navigation.

source

fn is_focused(&self) -> bool

Focused?

source

fn lost_focus(&self) -> bool

Just lost focus.

source

fn gained_focus(&self) -> bool

Just gained focus.

Implementors§