@@ -204,32 +204,12 @@ pub enum Overflow {
204
204
Hidden ,
205
205
}
206
206
207
- /// Defines if child UI items appear on a single line or on multiple lines
208
- #[ derive(
209
- Component , Copy , Clone , PartialEq , Eq , Debug , Default , Serialize , Deserialize , Reflect ,
210
- ) ]
211
- #[ reflect_value( PartialEq , Serialize , Deserialize ) ]
212
- pub enum Wrap {
213
- /// Single line, will overflow if needed
214
- #[ default]
215
- NoWrap ,
216
- /// Multiple lines, if needed
217
- Wrap ,
218
- /// Same as [`FlexWrap::Wrap`] but new lines will appear before the previous one
219
- WrapReverse ,
220
- }
221
-
222
207
/// Flexbox-specific layout components
223
208
pub mod flex {
224
- use super :: {
225
- LayoutStrategy , Offset , Overflow , PositionType , SizeConstraints , Spacing , TextDirection ,
226
- Wrap ,
227
- } ;
228
- use crate :: Val ;
229
- use bevy_ecs:: prelude:: Component ;
209
+
230
210
use bevy_ecs:: query:: { Changed , Or , WorldQuery } ;
231
- use bevy_reflect :: prelude :: * ;
232
- use serde :: { Deserialize , Serialize } ;
211
+
212
+ use super :: * ;
233
213
234
214
/// A query for all of the components need for flexbox layout.
235
215
///
@@ -250,8 +230,6 @@ pub mod flex {
250
230
pub flex_layout : & ' static FlexLayout ,
251
231
/// The direction of the text
252
232
pub text_direction : & ' static TextDirection ,
253
- /// Controls how the content wraps
254
- pub wrap : & ' static Wrap ,
255
233
/// The behavior in case the node overflows its allocated space
256
234
pub overflow : & ' static Overflow ,
257
235
}
@@ -286,6 +264,8 @@ pub mod flex {
286
264
pub align_content : AlignContent ,
287
265
/// Aligns this containers items along the main-axis
288
266
pub justify_content : JustifyContent ,
267
+ /// Controls how the content wraps
268
+ pub wrap : Wrap ,
289
269
/// Defines how much a flexbox item should grow if there's space available
290
270
pub grow : f32 ,
291
271
/// How to shrink if there's not enough space available
@@ -302,6 +282,7 @@ pub mod flex {
302
282
align_self : Default :: default ( ) ,
303
283
align_content : Default :: default ( ) ,
304
284
justify_content : Default :: default ( ) ,
285
+ wrap : Default :: default ( ) ,
305
286
grow : 0.0 ,
306
287
shrink : 1.0 ,
307
288
basis : Val :: Auto ,
@@ -401,4 +382,17 @@ pub mod flex {
401
382
/// Like [`JustifyContent::SpaceAround`] but with even spacing between items
402
383
SpaceEvenly ,
403
384
}
385
+
386
+ /// Defines if flexbox items appear on a single line or on multiple lines
387
+ #[ derive( Copy , Clone , PartialEq , Eq , Debug , Default , Serialize , Deserialize , Reflect ) ]
388
+ #[ reflect_value( PartialEq , Serialize , Deserialize ) ]
389
+ pub enum Wrap {
390
+ /// Single line, will overflow if needed
391
+ #[ default]
392
+ NoWrap ,
393
+ /// Multiple lines, if needed
394
+ Wrap ,
395
+ /// Same as [`FlexWrap::Wrap`] but new lines will appear before the previous one
396
+ WrapReverse ,
397
+ }
404
398
}
0 commit comments