1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#![doc(
    html_logo_url = "https://rillrate.com/images/logo/rr-stack.svg",
    html_favicon_url = "https://rillrate.com/images/favicon.png",
    html_root_url = "https://docs.rillrate.com/"
)]

//! Pack with layouts that arranges UI components automatically.
//!
//! # Auto-layouts concept
//!
//! Auto layouts allow developer avoid spending time on manual
//! arranging of UI elements.
//!
//! Each of the auto layouts uses own rules for the placement
//! of elements. You can find out more about them in the
//! documentation of corresponding modules.
//!
//! # Usage
//!
//! To use the auto layout, you need to create an instance of it
//! and attach it to root layout. For example, the following code
//! creates an instance of `ColumnLayout` and attaches it as the
//! global root layout to a `Supervisor` instance:
//!
//! ```rust
//! use way_auto_layout::ColumnLayout;
//! let column_layout = ColumnLayout::new("local.layout.column");
//! // Set the layout to the root:
//! // supervisor.set_root(&column_layout.flow_bind)?;
//! ```

#[cfg(feature = "column-layout")]
pub mod column_layout;

#[cfg(feature = "backend")]
pub use all::*;

#[cfg(feature = "backend")]
mod all {
    #[cfg(feature = "column-layout")]
    pub use crate::column_layout::ColumnLayout;
}

/// Adds widgets to the registry of the `way-basis` pack.
#[cfg(feature = "frontend")]
pub fn install_widgets() {
    #[allow(unused_imports)]
    use way_basis::register;
    #[cfg(feature = "column-layout")]
    register::<column_layout::ColumnLayoutState, column_layout::widget::ColumnLayout, _>();
}