Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to bevy main #309

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Update to bevy main #309

wants to merge 3 commits into from

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented Sep 24, 2024

Currently testing on bevy commit 9386bd0

src/lib.rs Outdated
@@ -797,6 +798,8 @@ pub struct EguiContextQuery {
pub render_target_size: &'static mut RenderTargetSize,
/// [`Window`] component, when rendering to a window.
pub window: Option<&'static mut Window>,
/// Cursor for the
Copy link
Contributor

@Friz64 Friz64 Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfinished comment

Copy link
Contributor Author

@Vrixyz Vrixyz Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out!

It's part of an actually a non trivial change: The handling of the cursor is changed in bevy 0.15 ; in this PR I moved the initialization of the cursor to the user through configure_cursor :

bevy_egui/examples/ui.rs

Lines 56 to 60 in 3be113b

fn configure_cursor(mut commands: Commands, windows: Query<Entity, With<PrimaryWindow>>) {
commands
.entity(windows.single())
.insert(CursorIcon::System(SystemCursorIcon::Default));
}

But I think this code snippet should live with bevy_egui (or bevy_something 🤔 ; but in the meantime we should be able to add it if not present.)

@PPakalns
Copy link
Contributor

PPakalns commented Oct 3, 2024

Currently testing on bevy commit 9386bd0

* cursor handling changed, I think we should initialize it for all windows if not present (currently not implemented), see discussion: https://github.com/mvlabat/bevy_egui/pull/309/files#r1780569354

Just brainstorming cursor handling.
Maybe we could add for the window "EguiCursorIcon" component that bevy_egui sets.

We can provide a system that is added by default that correctly sets CursorIcon for the window from the egui EguiCursorIcon value.

But user could opt out:
User can handle manually EguiCursorIcon, it could be useful in cases where user would like to read the EguiCursorIcon state, but would want to have custom logic (For example user is utilizing a lot of custom cursor icons. He needs information from egui about cursor type, but wants to manually set their own cursor icons from icon set that do not map to SystemCursorIcon enum.

In this case it would be nice if egui would not set CursorIcon component directly.


Probably this functionality could be added in a PR at later date.

@mvlabat mvlabat force-pushed the main branch 5 times, most recently from 879a24b to 8956b27 Compare October 4, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants