mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
output: more big refactors
This commit is contained in:
parent
194f2f9874
commit
5e6338fad8
68 changed files with 1604 additions and 1016 deletions
25
output/src/widget/widget_field.rs
Normal file
25
output/src/widget/widget_field.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
use crate::*;
|
||||
|
||||
pub struct FieldH<Theme, Label, Value>(pub Theme, pub Label, pub Value);
|
||||
impl<O: Out, T, L: Draw<O>, V: Draw<O>> Layout<O> for FieldH<T, L, V> where Self: Content<O> {
|
||||
fn layout (&self, to: O::Area) -> O::Area {
|
||||
self.content().layout(to)
|
||||
}
|
||||
}
|
||||
impl<O: Out, T, L: Draw<O>, V: Draw<O>> Draw<O> for FieldH<T, L, V> where Self: Content<O> {
|
||||
fn draw (&self, to: &mut O) {
|
||||
self.content().draw(to)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct FieldV<Theme, Label, Value>(pub Theme, pub Label, pub Value);
|
||||
impl<O: Out, T, L: Draw<O>, V: Draw<O>> Layout<O> for FieldV<T, L, V> where Self: Content<O> {
|
||||
fn layout (&self, to: O::Area) -> O::Area {
|
||||
self.content().layout(to)
|
||||
}
|
||||
}
|
||||
impl<O: Out, T, L: Draw<O>, V: Draw<O>> Draw<O> for FieldV<T, L, V> where Self: Content<O> {
|
||||
fn draw (&self, to: &mut O) {
|
||||
self.content().draw(to)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue