Skip to content

Commit

Permalink
Feature flag TaffyLayout widget
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Nov 22, 2023
1 parent 875bfaf commit 34eca92
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ default-target = "x86_64-pc-windows-msvc"
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]

[features]
default = ["x11"]
default = ["x11", "taffy"]

x11 = ["glazier/x11"]
wayland = ["glazier/wayland"]
taffy = ["dep:taffy"]

[dependencies]
xilem_core.workspace = true
taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "7781c70241f7f572130c13106f2a869a9cf80885" }
taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "7781c70241f7f572130c13106f2a869a9cf80885", optional = true }
vello = { git = "https://github.com/linebender/vello", rev = "9d7c4f00d8db420337706771a37937e9025e089c" }
wgpu = "0.17.0"
parley = { git = "https://github.com/dfrg/parley", rev = "2371bf4b702ec91edee2d58ffb2d432539580e1e" }
Expand Down
8 changes: 6 additions & 2 deletions src/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod text;
// mod use_state;
mod linear_layout;
mod list;
mod taffy_layout;

#[allow(clippy::module_inception)]
mod view;

Expand All @@ -30,5 +30,9 @@ pub use xilem_core::{Id, IdPath, VecSplice};
pub use button::button;
pub use linear_layout::{h_stack, v_stack, LinearLayout};
pub use list::{list, List};
pub use taffy_layout::{div, flex_column, flex_row, TaffyLayout};
pub use view::{Adapt, AdaptState, Cx, Memoize, View, ViewMarker, ViewSequence};

#[cfg(feature = "taffy")]
mod taffy_layout;
#[cfg(feature = "taffy")]
pub use taffy_layout::{div, flex_column, flex_row, TaffyLayout};
9 changes: 7 additions & 2 deletions src/widget/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod core;
mod linear_layout;
mod piet_scene_helpers;
mod raw_event;
mod taffy_layout;

//mod scroll_view;
mod text;
#[allow(clippy::module_inception)]
Expand All @@ -34,6 +34,11 @@ pub use button::Button;
pub use contexts::{AccessCx, CxState, EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx};
pub use linear_layout::LinearLayout;
pub use raw_event::{Event, LifeCycle, MouseEvent, ViewContext};
pub use taffy_layout::TaffyLayout;

pub use text::TextWidget;
pub use widget::{AnyWidget, Widget};

#[cfg(feature = "taffy")]
mod taffy_layout;
#[cfg(feature = "taffy")]
pub use taffy_layout::TaffyLayout;

0 comments on commit 34eca92

Please sign in to comment.