Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings
RUSTFLAGS: --deny warnings -C debuginfo=line-tables-only
RUSTDOCFLAGS: --deny warnings
# This can be any valid Cargo version requirement, but should start with a caret `^` to opt-in to
# SemVer-compatible changes. Please keep this in sync with `book.yaml`.
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ unsafe_op_in_unsafe_fn = "warn"
unused_qualifications = "warn"

[workspace.dependencies]
bevy = { git = "https://github.com/cart/bevy.git", rev = "40e6f12bbad44dfe2566fda2ead83469d53717d0", features = [
bevy = { git = "https://github.com/cart/bevy.git", rev = "05b79c229a070224c007994e5c2be8b67439d7d9", features = [
"wayland",
"experimental_bevy_feathers",
] }
bevy_render = { git = "https://github.com/cart/bevy.git", rev = "40e6f12bbad44dfe2566fda2ead83469d53717d0" }
bevy_derive = { git = "https://github.com/cart/bevy.git", rev = "40e6f12bbad44dfe2566fda2ead83469d53717d0" }
bevy_macro_utils = { git = "https://github.com/cart/bevy.git", rev = "40e6f12bbad44dfe2566fda2ead83469d53717d0" }
bevy_render = { git = "https://github.com/cart/bevy.git", rev = "05b79c229a070224c007994e5c2be8b67439d7d9" }
bevy_derive = { git = "https://github.com/cart/bevy.git", rev = "05b79c229a070224c007994e5c2be8b67439d7d9" }
bevy_macro_utils = { git = "https://github.com/cart/bevy.git", rev = "05b79c229a070224c007994e5c2be8b67439d7d9" }
thiserror = "2.0"
serde = { version = "1", features = ["derive"] }
tracing-test = "0.2.5"
Expand Down
1 change: 0 additions & 1 deletion bevy_editor_panes/bevy_2d_viewport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ fn on_pane_creation(
],
]
})
.insert(Node::default())
.insert(ChildOf(structure.root));

commands
Expand Down
1 change: 0 additions & 1 deletion bevy_editor_panes/bevy_3d_viewport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ fn on_pane_creation(
],
]
})
.insert(Node::default())
.insert(ChildOf(structure.root));

let camera_id = commands
Expand Down
32 changes: 4 additions & 28 deletions bevy_editor_panes/bevy_asset_browser/src/ui/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
use atomicow::CowArc;
use bevy::{
asset::io::{AssetSource, AssetSourceBuilders, AssetSourceId},
feathers::cursor::EntityCursor,
prelude::*,
window::SystemCursorIcon,
winit::cursor::CursorIcon,
};
use bevy_context_menu::{ContextMenu, ContextMenuOption};
use bevy_editor_styles::Theme;
Expand Down Expand Up @@ -200,7 +200,7 @@ pub(crate) fn spawn_file_node<'a>(
}

fn spawn_base_node<'a>(commands: &'a mut Commands, theme: &Res<Theme>) -> EntityCommands<'a> {
let mut base_node_ec = commands.spawn((
commands.spawn((
Button,
Node {
margin: UiRect::all(Val::Px(5.0)),
Expand All @@ -215,30 +215,6 @@ fn spawn_base_node<'a>(commands: &'a mut Commands, theme: &Res<Theme>) -> Entity
},
ZIndex(1),
theme.general.border_radius,
));

// Hover effect
base_node_ec
.observe(
move |_trigger: On<Pointer<Move>>,
window_query: Query<Entity, With<Window>>,
mut commands: Commands| {
let window = window_query.single().unwrap();
commands
.entity(window)
.insert(CursorIcon::System(SystemCursorIcon::Pointer));
},
)
.observe(
move |_trigger: On<Pointer<Out>>,
window_query: Query<Entity, With<Window>>,
mut commands: Commands| {
let window = window_query.single().unwrap();
commands
.entity(window)
.insert(CursorIcon::System(SystemCursorIcon::Default));
},
);

base_node_ec
EntityCursor::System(SystemCursorIcon::Pointer),
))
}
23 changes: 2 additions & 21 deletions bevy_editor_panes/bevy_asset_browser/src/ui/top_bar.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, window::SystemCursorIcon, winit::cursor::CursorIcon};
use bevy::{feathers::cursor::EntityCursor, prelude::*, window::SystemCursorIcon};
use bevy_editor_styles::Theme;

use crate::{AssetBrowserLocation, io};
Expand Down Expand Up @@ -130,6 +130,7 @@ fn spawn_path_segment_ui<'a>(
BackgroundColor(PATH_SEGMENT_BACKGROUND_COLOR),
theme.general.border_radius,
segment_type,
EntityCursor::System(SystemCursorIcon::Pointer),
));
segment_ec
.with_children(|parent| {
Expand Down Expand Up @@ -178,26 +179,6 @@ fn spawn_path_segment_ui<'a>(
};
commands.run_system_cached(io::task::fetch_directory_content);
},
)
.observe(
move |_trigger: On<Pointer<Move>>,
window_query: Query<Entity, With<Window>>,
mut commands: Commands| {
let window = window_query.single().unwrap();
commands
.entity(window)
.insert(CursorIcon::System(SystemCursorIcon::Pointer));
},
)
.observe(
move |_trigger: On<Pointer<Out>>,
window_query: Query<Entity, With<Window>>,
mut commands: Commands| {
let window = window_query.single().unwrap();
commands
.entity(window)
.insert(CursorIcon::System(SystemCursorIcon::Default));
},
);
segment_ec
}
Expand Down
2 changes: 0 additions & 2 deletions bevy_editor_panes/bevy_properties_pane/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ fn setup_pane(pane: In<PaneStructure>, mut commands: Commands) {
PropertiesPaneBody
]
})
.insert(Node::default())
.insert(ChildOf(pane.root));
}

Expand All @@ -57,7 +56,6 @@ fn update_properties_pane(
commands.entity(pane_body).despawn_children();
commands
.spawn_scene(properties_pane(&selection, world))
.insert(Node::default())
.insert(ChildOf(pane_body));
}
}
Expand Down
23 changes: 2 additions & 21 deletions bevy_widgets/bevy_context_menu/src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, window::SystemCursorIcon, winit::cursor::CursorIcon};
use bevy::{feathers::cursor::EntityCursor, prelude::*, window::SystemCursorIcon};
use bevy_editor_styles::Theme;

use crate::ContextMenu;
Expand Down Expand Up @@ -55,6 +55,7 @@ pub(crate) fn spawn_option<'a>(
..default()
},
theme.context_menu.option_border_radius,
EntityCursor::System(SystemCursorIcon::Pointer),
))
.observe(
|trigger: On<Pointer<Over>>,
Expand All @@ -68,26 +69,6 @@ pub(crate) fn spawn_option<'a>(
query.get_mut(trigger.target()).unwrap().0 = Color::NONE;
},
)
.observe(
move |_trigger: On<Pointer<Over>>,
window_query: Query<Entity, With<Window>>,
mut commands: Commands| {
let window = window_query.single().unwrap();
commands
.entity(window)
.insert(CursorIcon::System(SystemCursorIcon::Pointer));
},
)
.observe(
|_trigger: On<Pointer<Out>>,
window_query: Query<Entity, With<Window>>,
mut commands: Commands| {
let window = window_query.single().unwrap();
commands
.entity(window)
.insert(CursorIcon::System(SystemCursorIcon::Default));
},
)
.observe(
move |trigger: On<Pointer<Release>>,
mut commands: Commands,
Expand Down
34 changes: 17 additions & 17 deletions bevy_widgets/bevy_text_editing/src/editable_text_line/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ pub fn on_key_input(
// Process modifier key combinations
match &input.key_code {
KeyCode::KeyC => {
if let Some(selected_text) = text_field.get_selected_text() {
if let Err(e) = clipboard.set_text(selected_text) {
warn!("Clipboard error: {}", e);
}
if let Some(selected_text) = text_field.get_selected_text()
&& let Err(e) = clipboard.set_text(selected_text)
{
warn!("Clipboard error: {}", e);
}
}
KeyCode::KeyV => match clipboard.get_text() {
Expand All @@ -114,10 +114,10 @@ pub fn on_key_input(
}
},
KeyCode::KeyX => {
if let Some(selected_text) = text_field.get_selected_text() {
if let Err(e) = clipboard.set_text(selected_text) {
warn!("Clipboard error: {}", e);
}
if let Some(selected_text) = text_field.get_selected_text()
&& let Err(e) = clipboard.set_text(selected_text)
{
warn!("Clipboard error: {}", e);
}
if let Some(selected_range) = text_field.selection_range() {
text_change = TextChange::remove_change(selected_range);
Expand All @@ -137,10 +137,10 @@ pub fn on_key_input(
// Process regular (non-modifier) key press
match &input.logical_key {
Key::Space => {
if let Some(allowed_chars) = &text_field.allowed_chars {
if !allowed_chars.contains(&' ') {
return;
}
if let Some(allowed_chars) = &text_field.allowed_chars
&& !allowed_chars.contains(&' ')
{
return;
}

if let Some((start, end)) = text_field.selection_range() {
Expand Down Expand Up @@ -269,11 +269,11 @@ pub fn update_has_focus(
// Gained focus
commands.entity(entity).insert(HasFocus(true));

if let Ok(mut text_field) = q_editable_texts.get_mut(entity) {
if text_field.cursor_position.is_none() {
text_field.cursor_position = Some(CharPosition(0));
commands.trigger_targets(RenderWidget::show_cursor(), entity);
}
if let Ok(mut text_field) = q_editable_texts.get_mut(entity)
&& text_field.cursor_position.is_none()
{
text_field.cursor_position = Some(CharPosition(0));
commands.trigger_targets(RenderWidget::show_cursor(), entity);
}
}
} else if has_focus.0 {
Expand Down
33 changes: 16 additions & 17 deletions crates/bevy_editor_settings/src/file_system/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ pub fn load_preferences(world: &mut World, table: toml::Table, settings_type: Se
.map(|key| key.0.to_string())
.unwrap_or_else(|| enm.reflect_type_ident().unwrap().to_snake_case());

if let Some(table) = table.get(&name).and_then(|v| v.as_table()) {
if let Some(value) = table.get("variant") {
LoadEnum {
enum_info,
enm,
toml_value: value,
}
.load_enum();
if let Some(table) = table.get(&name).and_then(|v| v.as_table())
&& let Some(value) = table.get("variant")
{
LoadEnum {
enum_info,
enm,
toml_value: value,
}
.load_enum();
}
}
}
Expand All @@ -274,17 +274,16 @@ pub fn load_preferences(world: &mut World, table: toml::Table, settings_type: Se
tuple_struct.reflect_type_ident().unwrap().to_snake_case()
});

if let Some(table) = table.get(&name).and_then(|v| v.as_table()) {
if let Some(array_value) =
if let Some(table) = table.get(&name).and_then(|v| v.as_table())
&& let Some(array_value) =
table.get("fields").and_then(|v| v.as_array())
{
LoadTupleStruct {
tuple_struct_info,
table: array_value,
tuple_struct,
}
.load_tuple_struct();
{
LoadTupleStruct {
tuple_struct_info,
table: array_value,
tuple_struct,
}
.load_tuple_struct();
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_editor_settings/src/file_system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ pub fn global_settings_path() -> Option<PathBuf> {
let config_dir = path.config_dir();
let path = config_dir.join(SETTINGS_BASE_DIR);

if !path.exists() {
if let Err(e) = std::fs::create_dir_all(&path) {
error!("Failed to create global settings directory: {}", e);
return None;
}
if !path.exists()
&& let Err(e) = std::fs::create_dir_all(&path)
{
error!("Failed to create global settings directory: {}", e);
return None;
}
Some(path)
}
Expand Down
Loading