Trait gtk4::subclass::layout_manager::LayoutManagerImpl
source · pub trait LayoutManagerImpl: LayoutManagerImplExt + ObjectImpl {
// Provided methods
fn allocate(&self, widget: &Widget, width: i32, height: i32, baseline: i32) { ... }
fn create_layout_child(
&self,
widget: &Widget,
for_child: &Widget
) -> LayoutChild { ... }
fn layout_child_type() -> Option<Type> { ... }
fn request_mode(&self, widget: &Widget) -> SizeRequestMode { ... }
fn measure(
&self,
widget: &Widget,
orientation: Orientation,
for_size: i32
) -> (i32, i32, i32, i32) { ... }
fn root(&self) { ... }
fn unroot(&self) { ... }
}
Provided Methods§
sourcefn allocate(&self, widget: &Widget, width: i32, height: i32, baseline: i32)
fn allocate(&self, widget: &Widget, width: i32, height: i32, baseline: i32)
Assigns the given @width, @height, and @baseline to a @widget, and computes the position and sizes of the children of the @widget using the layout management policy of @self.
widget
the Widget
using @self
width
the new width of the @widget
height
the new height of the @widget
baseline
the baseline position of the @widget, or -1
sourcefn create_layout_child(
&self,
widget: &Widget,
for_child: &Widget
) -> LayoutChild
fn create_layout_child( &self, widget: &Widget, for_child: &Widget ) -> LayoutChild
Create a LayoutChild
instance for the given @for_child widget.
widget
the widget using the @self
for_child
the child of @widget
Returns
sourcefn layout_child_type() -> Option<Type>
fn layout_child_type() -> Option<Type>
Only set if the child implemented LayoutChildImpl
fn request_mode(&self, widget: &Widget) -> SizeRequestMode
sourcefn measure(
&self,
widget: &Widget,
orientation: Orientation,
for_size: i32
) -> (i32, i32, i32, i32)
fn measure( &self, widget: &Widget, orientation: Orientation, for_size: i32 ) -> (i32, i32, i32, i32)
Measures the size of the @widget using @self, for the given @orientation and size.
See the Widget
documentation on layout management for
more details.
widget
the Widget
using @self
orientation
the orientation to measure
for_size
Size for the opposite of @orientation; for instance, if
the @orientation is Orientation::Horizontal
, this is the height
of the widget; if the @orientation is Orientation::Vertical
, this
is the width of the widget. This allows to measure the height for the
given width, and the width for the given height. Use -1 if the size
is not known
Returns
minimum
the minimum size for the given size and orientation
natural
the natural, or preferred size for the given size and orientation
minimum_baseline
the baseline position for the minimum size
natural_baseline
the baseline position for the natural size