Skip to content

Commit fff4e31

Browse files
committed
Added Utils module
1 parent c9b7d95 commit fff4e31

16 files changed

Lines changed: 96 additions & 81 deletions

efx/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
#![doc = include_str!("../docs/guide.md")]
66

77
mod attr_adapters;
8-
mod buffer;
98
mod input;
109
mod render;
1110
mod tags;
11+
mod utils;
1212

1313
use proc_macro::TokenStream;
1414
use quote::quote;
1515
use syn::parse_macro_input;
1616

17-
use crate::buffer::build_buffer_from_children;
1817
use crate::input::EfxInput;
1918
use crate::render::render_nodes_as_stmts;
2019
use crate::tags::Button;

efx/src/tags/button.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use crate::buffer::build_buffer_from_children;
2-
use crate::tags::util::*;
31
use crate::tags::{Tag, TagAttributes};
42
use efx_attrnames::AttrNames;
53
use efx_core::Element;
64
use proc_macro2::TokenStream;
75
use quote::{ToTokens, quote};
6+
use crate::utils::attr::*;
7+
use crate::utils::buffer::build_buffer_from_children;
88

99
pub struct Button {
1010
attributes: Attributes,

efx/src/tags/central_panel.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
use crate::tags::util::*;
21
use crate::tags::{Tag, TagAttributes};
32
use efx_attrnames::AttrNames;
43
use efx_core::Element;
54
use proc_macro2::TokenStream;
65
use quote::{ToTokens, quote};
6+
use crate::utils::attr::*;
7+
use crate::utils::render::render_children_stmt;
78

89
pub struct CentralPanel {
910
attributes: Attributes,

efx/src/tags/column.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use proc_macro2::TokenStream;
33
use quote::{ToTokens, quote};
44

55
use crate::render::render_nodes_as_stmts;
6-
use crate::tags::util::{attr_map, f32_opt};
76
use crate::tags::{Block, TagAttributes};
87
use efx_attrnames::AttrNames;
8+
use crate::utils::attr::*;
99

1010
pub struct Column {
1111
attributes: Attributes,

efx/src/tags/hyperlink.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use crate::buffer::build_buffer_from_children;
2-
use crate::tags::util::*;
31
use crate::tags::{Tag, TagAttributes};
42
use efx_attrnames::AttrNames;
53
use efx_core::Element;
64
use proc_macro2::TokenStream;
75
use quote::{ToTokens, quote};
6+
use crate::utils::attr::*;
7+
use crate::utils::buffer::build_buffer_from_children;
88

99
/// <Hyperlink url="..." [open_external=bool] [color=...] [underline=bool] [tooltip=...]>text?</Hyperlink>
1010
pub struct Hyperlink {

efx/src/tags/label.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use crate::build_buffer_from_children;
2-
use crate::tags::util::{attr_map, bool_opt, color_tokens_opt, f32_opt};
31
use crate::tags::{Tag, TagAttributes};
42
use efx_attrnames::AttrNames;
53
use efx_core::Element;
64
use proc_macro2::TokenStream;
75
use quote::{ToTokens, quote};
6+
use crate::utils::attr::*;
7+
use crate::utils::buffer::build_buffer_from_children;
88

99
pub struct Label {
1010
attributes: Attributes,

efx/src/tags/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub mod row;
77
pub mod scroll_area;
88
pub mod separator;
99
pub mod text_field;
10-
pub mod util;
1110
pub mod window;
1211

1312
pub use button::Button;

efx/src/tags/row.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::render::render_nodes_as_stmts;
2-
use crate::tags::util::{attr_map, bool_or, f32_opt};
32
use crate::tags::{Block, TagAttributes};
43
use efx_attrnames::AttrNames;
54
use efx_core::Element;
65
use proc_macro2::TokenStream;
76
use quote::{ToTokens, quote};
7+
use crate::utils::attr::*;
88

99
pub struct Row {
1010
attributes: Attributes,

efx/src/tags/scroll_area.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
use crate::tags::util::*;
21
use crate::tags::{Tag, TagAttributes};
32
use efx_attrnames::AttrNames;
43
use efx_core::Element;
54
use proc_macro2::TokenStream;
65
use quote::{ToTokens, quote};
6+
use crate::utils::attr::*;
7+
use crate::utils::render::render_children_stmt;
78

89
pub struct ScrollArea {
910
attributes: Attributes,

efx/src/tags/separator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use crate::tags::util::{attr_map, f32_opt};
21
use crate::tags::{Block, TagAttributes};
32
use efx_attrnames::AttrNames;
43
use efx_core::Element;
54
use proc_macro2::TokenStream;
65
use quote::{ToTokens, quote};
6+
use crate::utils::attr::*;
77

88
pub struct Separator {
99
attributes: Attributes,

0 commit comments

Comments
 (0)