mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-01-11 10:36:41 +01:00
31 lines
899 B
Rust
31 lines
899 B
Rust
#[allow(unused)] use crate::*;
|
|
|
|
/// A three-column layout.
|
|
pub struct Tryptich<A, B, C> {
|
|
pub top: bool,
|
|
pub h: u16,
|
|
pub left: (u16, A),
|
|
pub middle: (u16, B),
|
|
pub right: (u16, C),
|
|
}
|
|
|
|
impl Tryptich<(), (), ()> {
|
|
pub fn center (h: u16) -> Self {
|
|
Self { h, top: false, left: (0, ()), middle: (0, ()), right: (0, ()) }
|
|
}
|
|
pub fn top (h: u16) -> Self {
|
|
Self { h, top: true, left: (0, ()), middle: (0, ()), right: (0, ()) }
|
|
}
|
|
}
|
|
|
|
impl<A, B, C> Tryptich<A, B, C> {
|
|
pub fn left <D> (self, w: u16, content: D) -> Tryptich<D, B, C> {
|
|
Tryptich { left: (w, content), ..self }
|
|
}
|
|
pub fn middle <D> (self, w: u16, content: D) -> Tryptich<A, D, C> {
|
|
Tryptich { middle: (w, content), ..self }
|
|
}
|
|
pub fn right <D> (self, w: u16, content: D) -> Tryptich<A, B, D> {
|
|
Tryptich { right: (w, content), ..self }
|
|
}
|
|
}
|