Skip to content

Commit

Permalink
On Web, remove Window::is_dark_mode() (rust-windowing#2951)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda authored Jul 11, 2023
1 parent 44e2f95 commit 5379d60
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ And please only add new entries to the top of this list, right below the `# Unre
- On Web, fix some `Window` methods using incorrect HTML attributes instead of CSS properties.
- On Web, fix some `WindowBuilder` methods doing nothing.
- On Web, implement `Window::focus_window()`.
- On Web, remove unnecessary `Window::is_dark_mode()`, which was replaced with `Window::theme()`.

# 0.29.0-beta.0

Expand Down
3 changes: 0 additions & 3 deletions src/platform/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ use web_sys::HtmlCanvasElement;
pub trait WindowExtWebSys {
/// Only returns the canvas if called from inside the window.
fn canvas(&self) -> Option<HtmlCanvasElement>;

/// Whether the browser reports the preferred color scheme to be "dark".
fn is_dark_mode(&self) -> bool;
}

pub trait WindowBuilderExtWebSys {
Expand Down
6 changes: 0 additions & 6 deletions src/platform_impl/web/web_sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ impl WindowExtWebSys for Window {
fn canvas(&self) -> Option<HtmlCanvasElement> {
self.window.canvas()
}

fn is_dark_mode(&self) -> bool {
self.window
.inner
.queue(|inner| is_dark_mode(&inner.window).unwrap_or(false))
}
}

pub fn scale_factor(window: &web_sys::Window) -> f64 {
Expand Down

0 comments on commit 5379d60

Please sign in to comment.