pub struct RelativeLayout {
pub placement: RelativePlacement,
pub auto_hide: RelativeAutoHide,
pub auto_hide_request: Callback<()>,
pub uncovered_controls: Vec<Weak<RefCell<dyn ControlObject>>>,
}Expand description
Warning!
RelativeLayout is designed to work with Popup control and it’s dangerous (danger of panic) to use outside of it.
It works correctly only when:
- Covers whole window.
- References only controls on lower layouts.
The lower layout control is a control that:
- is not lying on the path from RelativeLayout to root (that would cause borrow panic during layout phase)
- it’s layout phase is calculated before the layout phase of RelativeLayout (RelativeLayout refers to calculated size of that control)
Fields§
§placement: RelativePlacement§auto_hide: RelativeAutoHideAuto hide method.
Defines rules when to call auto_hide_request callback.
auto_hide_request: Callback<()>Called when auto hide is requested.
uncovered_controls: Vec<Weak<RefCell<dyn ControlObject>>>RelativeLayout does not pass through events to controls below except the area covered by this list of controls
Implementations§
Source§impl RelativeLayout
impl RelativeLayout
Sourcepub fn builder() -> RelativeLayoutBuilder<((), (), (), ())>
pub fn builder() -> RelativeLayoutBuilder<((), (), (), ())>
Create a builder for building RelativeLayout.
On the builder, call .placement(...)(optional), .auto_hide(...)(optional), .auto_hide_request(...)(optional), .uncovered_controls(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of RelativeLayout.
Source§impl RelativeLayout
impl RelativeLayout
pub fn to_view( self, style: Option<Box<dyn Style<Self>>>, context: ViewContext, ) -> Rc<RefCell<dyn ControlObject>>
Trait Implementations§
Source§impl Style<RelativeLayout> for DefaultRelativeLayoutStyle
impl Style<RelativeLayout> for DefaultRelativeLayoutStyle
fn setup( &mut self, _data: &mut RelativeLayout, _control_context: &mut ControlContext, )
fn handle_event( &mut self, data: &mut RelativeLayout, _control_context: &mut ControlContext, _drawing_context: &mut FuiDrawingContext<'_>, _event_context: &mut dyn EventContext, event: ControlEvent, )
fn measure( &mut self, _data: &mut RelativeLayout, _control_context: &mut ControlContext, _drawing_context: &mut FuiDrawingContext<'_>, size: Size, ) -> Size
fn set_rect( &mut self, data: &mut RelativeLayout, control_context: &mut ControlContext, drawing_context: &mut FuiDrawingContext<'_>, rect: Rect, )
fn hit_test( &self, data: &RelativeLayout, control_context: &ControlContext, point: Point, ) -> Option<Rc<RefCell<dyn ControlObject>>>
fn draw( &mut self, _data: &RelativeLayout, control_context: &ControlContext, drawing_context: &mut FuiDrawingContext<'_>, )
Auto Trait Implementations§
impl Freeze for RelativeLayout
impl !RefUnwindSafe for RelativeLayout
impl !Send for RelativeLayout
impl !Sync for RelativeLayout
impl Unpin for RelativeLayout
impl UnsafeUnpin for RelativeLayout
impl !UnwindSafe for RelativeLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more