Skip to content

Commit cff9a7a

Browse files
committed
CI
1 parent 77a334b commit cff9a7a

File tree

9 files changed

+40
-48
lines changed

9 files changed

+40
-48
lines changed

crates/bevy_clipboard/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ impl ClipboardRead {
6161
pub struct ClipboardBasic(pub String);
6262
// TODO: remove ClipboardNotSupported , write into ClipboardBasic instead
6363

64-
6564
/// Resource providing access to the clipboard
6665
#[cfg(unix)]
6766
#[derive(Resource)]

crates/bevy_text/src/input/text_edit.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pub use cosmic_text::Motion;
1212
use cosmic_text::{Action, BorrowedWithFontSystem, Edit, Editor, Selection};
1313

1414
use crate::{
15-
get_cosmic_text_buffer_contents, CosmicFontSystem, TextInputAttributes,
16-
TextInputBuffer, TextInputFilter, TextInputValue,
15+
get_cosmic_text_buffer_contents, CosmicFontSystem, TextInputAttributes, TextInputBuffer,
16+
TextInputFilter, TextInputValue,
1717
};
1818

1919
/// Text input commands queue
@@ -198,7 +198,8 @@ pub fn apply_text_edits(
198198
clipboard.as_mut(),
199199
&action,
200200
) {
201-
commands.trigger_targets(TextInputEvent::InvalidEdit(error, action), entity);
201+
commands
202+
.trigger_targets(TextInputEvent::InvalidEdit(error, action), entity);
202203
}
203204
}
204205
}
@@ -231,7 +232,6 @@ pub fn apply_text_edit(
231232
clipboard: Option<&mut ResMut<Clipboard>>,
232233
edit: &TextEdit,
233234
) -> Result<(), InvalidTextEditError> {
234-
235235
editor.start_change();
236236

237237
match edit {
@@ -379,7 +379,6 @@ pub fn apply_text_edit(
379379
Ok(())
380380
}
381381

382-
383382
/// Automatically propagated events that can be dispatched by a text input entity.
384383
#[derive(EntityEvent, Clone, Debug, Component)]
385384
#[entity_event(traversal = &'static ChildOf, auto_propagate)]

crates/bevy_text/src/lib.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,20 @@ impl Plugin for TextPlugin {
110110
)
111111
.add_systems(Last, trim_cosmic_cache);
112112

113-
app.init_resource::<TextCursorBlinkInterval>()
114-
.add_systems(
115-
PostUpdate,
116-
(
117-
update_text_input_buffers,
118-
apply_text_edits,
119-
update_password_masks,
120-
update_text_input_layouts,
121-
update_placeholder_layouts,
122-
)
123-
.chain()
124-
.in_set(TextInputSystems)
125-
.before(AssetEventSystems)
126-
.ambiguous_with(Text2dUpdateSystems)
127-
);
113+
app.init_resource::<TextCursorBlinkInterval>().add_systems(
114+
PostUpdate,
115+
(
116+
update_text_input_buffers,
117+
apply_text_edits,
118+
update_password_masks,
119+
update_text_input_layouts,
120+
update_placeholder_layouts,
121+
)
122+
.chain()
123+
.in_set(TextInputSystems)
124+
.before(AssetEventSystems)
125+
.ambiguous_with(Text2dUpdateSystems),
126+
);
128127

129128
#[cfg(feature = "default_font")]
130129
{

crates/bevy_ui/src/widget/event.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use bevy_ecs::{
2-
component::Component, entity::Entity, event::EntityEvent
3-
};
1+
use bevy_ecs::{component::Component, entity::Entity, event::EntityEvent};
42

53
/// Represents one or more text inputs in a form being submitted
64
#[derive(EntityEvent, Clone, Debug, Component)]

crates/bevy_ui/src/widget/text_box.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ use bevy_picking::pointer::PointerButton;
5252
use bevy_text::Justify;
5353
use bevy_text::LineBreak;
5454
use bevy_text::Motion;
55-
use bevy_text::TextFont;
5655
use bevy_text::TextEdit;
5756
use bevy_text::TextEdits;
57+
use bevy_text::TextFont;
5858
use bevy_text::TextInputAttributes;
5959
use bevy_text::TextInputBuffer;
6060
use bevy_text::TextInputSystems;
@@ -149,7 +149,7 @@ impl Default for TextUnderCursorColor {
149149
TextInputStyle,
150150
TextInputMultiClickCounter,
151151
TextInputBuffer,
152-
TextCursorBlinkTimer,
152+
TextCursorBlinkTimer
153153
)]
154154
#[component(
155155
on_add = on_add_text_input_node,
@@ -429,7 +429,12 @@ impl Default for NextFocus {
429429
pub fn on_focused_keyboard_input(
430430
mut trigger: On<FocusedInput<KeyboardInput>>,
431431
mut commands: Commands,
432-
mut query: Query<(&mut TextEdits, Has<SingleLineInputField>, &TextBox, &TextInputBuffer)>,
432+
mut query: Query<(
433+
&mut TextEdits,
434+
Has<SingleLineInputField>,
435+
&TextBox,
436+
&TextInputBuffer,
437+
)>,
433438
mut modifiers: Option<ResMut<GlobalTextInputState>>,
434439
keyboard_state: Res<ButtonInput<Key>>,
435440
) {
@@ -500,10 +505,7 @@ pub fn on_focused_keyboard_input(
500505
}
501506
}
502507
Key::Home => {
503-
actions.queue(TextEdit::motion(
504-
Motion::BufferStart,
505-
is_shift_pressed,
506-
));
508+
actions.queue(TextEdit::motion(Motion::BufferStart, is_shift_pressed));
507509
}
508510
Key::End => {
509511
actions.queue(TextEdit::motion(Motion::BufferEnd, is_shift_pressed));

crates/bevy_ui/src/widget/text_field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ use bevy_picking::events::Pointer;
3636
use bevy_picking::events::Press;
3737
use bevy_picking::pointer::PointerButton;
3838
use bevy_text::Justify;
39-
use bevy_text::TextFont;
4039
use bevy_text::TextEdit;
4140
use bevy_text::TextEdits;
41+
use bevy_text::TextFont;
4242
use bevy_text::TextInputAttributes;
4343
use bevy_text::TextInputBuffer;
4444
use bevy_text::TextInputTarget;

crates/bevy_ui_render/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use gradient::GradientPlugin;
6262

6363
use bevy_platform::collections::{HashMap, HashSet};
6464
use bevy_text::{
65-
ComputedTextBlock, PositionedGlyph, PlaceholderLayout, TextBackgroundColor, TextColor,
65+
ComputedTextBlock, PlaceholderLayout, PositionedGlyph, TextBackgroundColor, TextColor,
6666
TextInputBuffer, TextLayoutInfo,
6767
};
6868
use bevy_transform::components::GlobalTransform;

examples/ui/password_input.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use bevy::input_focus::tab_navigation::TabNavigationPlugin;
1212
use bevy::input_focus::InputDispatchPlugin;
1313
use bevy::picking::hover::Hovered;
1414
use bevy::prelude::*;
15-
use bevy::text::Placeholder;
1615
use bevy::text::PasswordMask;
16+
use bevy::text::Placeholder;
1717
use bevy::text::TextInputValue;
1818
use bevy::ui::widget::TextField;
1919
use bevy::ui::widget::TextInputPlugin;
@@ -41,13 +41,12 @@ fn setup(mut commands: Commands) {
4141
// UI camera
4242
commands.spawn(Camera2d);
4343

44-
let on_click = commands.register_system(
45-
|_: In<Activate>, mut query: Query<&mut PasswordMask>| {
44+
let on_click =
45+
commands.register_system(|_: In<Activate>, mut query: Query<&mut PasswordMask>| {
4646
for mut password in query.iter_mut() {
4747
password.show_password = !password.show_password;
4848
}
49-
},
50-
);
49+
});
5150

5251
commands.spawn((
5352
Node {

examples/ui/text_input.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ use bevy::input_focus::InputFocus;
1313
use bevy::picking::hover::Hovered;
1414
use bevy::prelude::*;
1515
// use bevy::text::Clipboard;
16+
use bevy::text::PasswordMask;
1617
use bevy::text::Placeholder;
1718
use bevy::text::TextInputEvent;
1819
use bevy::text::TextInputFilter;
19-
use bevy::text::PasswordMask;
2020
use bevy::text::TextInputValue;
2121
use bevy::ui::widget::TextField;
2222
use bevy::ui::widget::TextInputPlugin;
@@ -51,10 +51,7 @@ struct Sounds {
5151
invalid: Handle<AudioSource>,
5252
}
5353

54-
fn setup(
55-
mut commands: Commands,
56-
asset_server: Res<AssetServer>,
57-
) {
54+
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
5855
// UI camera
5956
commands.spawn(Camera2d);
6057

@@ -146,10 +143,9 @@ fn setup(
146143
})
147144
.observe(
148145
move |on_submit: On<TextSubmission>,
149-
mut text_query: Query<&mut Text>,
150-
tab_nav: TabNavigation,
151-
mut input_focus: ResMut<InputFocus>,
152-
| {
146+
mut text_query: Query<&mut Text>,
147+
tab_nav: TabNavigation,
148+
mut input_focus: ResMut<InputFocus>| {
153149
if let Ok(mut text_node) = text_query.get_mut(on_submit.entity) {
154150
text_node.0 = on_submit.text.clone();
155151

@@ -162,7 +158,7 @@ fn setup(
162158
.observe(
163159
|on_text_input_event: On<TextInputEvent>,
164160
sounds: Res<Sounds>,
165-
161+
166162
mut commands: Commands| {
167163
match on_text_input_event.event() {
168164
TextInputEvent::InvalidEdit { .. } => {

0 commit comments

Comments
 (0)