[−][src]Trait kas::Layout
Positioning and drawing routines for widgets
These methods are often implemented via a derive trait, hence live in their own trait. (This may be revised in the future.)
Required methods
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
Get size rules for the given axis.
This method takes &mut self
to allow local caching of child widget
configuration for future size_rules
and set_rect
calls.
If operating on one axis and the other is fixed, then the other
parameter is used for the fixed dimension. Additionally, one may assume
that size_rules
has previously been called on the fixed axis with the
current widget configuration.
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
Draw a widget
This method is called to draw each visible widget (and should not attempt recursion on child widgets).
Provided methods
fn set_rect(&mut self, _size_handle: &mut dyn SizeHandle, rect: Rect)
Adjust to the given size.
For many widgets this operation is trivial and the default implementation will suffice. For layout widgets (those with children), this operation is more complex.
One may assume that size_rules
has been called for each axis with the
current widget configuration.
Implementations on Foreign Types
impl<M> Layout for Box<dyn Handler<Msg = M>>
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn set_rect(&mut self, size_handle: &mut dyn SizeHandle, rect: Rect)
[src]
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
[src]
Implementors
impl Layout for Label
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn draw(&self, draw_handle: &mut dyn DrawHandle, _: &Manager)
[src]
impl Layout for MessageBox
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn set_rect(&mut self, size_handle: &mut dyn SizeHandle, rect: Rect)
[src]
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
[src]
impl<D: Direction> Layout for ScrollBar<D>
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn set_rect(&mut self, size_handle: &mut dyn SizeHandle, rect: Rect)
[src]
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
[src]
impl<D: Direction, W: Widget> Layout for List<D, W>
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn set_rect(&mut self, size_handle: &mut dyn SizeHandle, rect: Rect)
[src]
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
[src]
impl<H: 'static> Layout for EditBox<H>
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn set_rect(&mut self, size_handle: &mut dyn SizeHandle, rect: Rect)
[src]
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
[src]
impl<M: Clone + Debug> Layout for TextButton<M>
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn set_rect(&mut self, size_handle: &mut dyn SizeHandle, rect: Rect)
[src]
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
[src]
impl<OT: 'static> Layout for CheckBox<OT>
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn set_rect(&mut self, size_handle: &mut dyn SizeHandle, rect: Rect)
[src]
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
[src]
impl<W: Widget + 'static> Layout for Window<W>
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
fn set_rect(&mut self, size_handle: &mut dyn SizeHandle, rect: Rect)
[src]
fn draw(&self, draw_handle: &mut dyn DrawHandle, mgr: &Manager)
[src]
impl<W: Widget> Layout for ScrollRegion<W>
[src]
fn size_rules(
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules
[src]
&mut self,
size_handle: &mut dyn SizeHandle,
axis: AxisInfo
) -> SizeRules