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

Support to set window theme and expose system window theme changed event #8593

Merged
merged 19 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add doc
  • Loading branch information
lewiszlw committed May 12, 2023
commit 5f9604394ba8ea33c70620018cb850dcd2b92cab
4 changes: 3 additions & 1 deletion crates/bevy_window/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ pub struct WindowMoved {
pub position: IVec2,
}

/// An event that is sent when system window theme has changed.
/// An event that is sent when system changed window theme.
lewiszlw marked this conversation as resolved.
Show resolved Hide resolved
///
/// It is only sent when [`Window::preferred_theme`](crate::window::Window::preferred_theme) is `None`.
lewiszlw marked this conversation as resolved.
Show resolved Hide resolved
#[derive(Debug, Clone, PartialEq, Eq, Reflect, FromReflect)]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
Expand Down
1 change: 1 addition & 0 deletions examples/window/window_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fn main() {
fit_canvas_to_parent: true,
// Tells wasm not to override default event handling, like F5, Ctrl+R etc.
prevent_default_event_handling: false,
preferred_theme: Some(WindowTheme::Dark),
..default()
}),
..default()
Expand Down