On Web, remove Window::is_dark_mode() (#2951)

This commit is contained in:
daxpedda 2023-07-11 18:26:32 +02:00 committed by GitHub
parent 44e2f95331
commit 5379d60e4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 9 deletions

View file

@ -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 `Window` methods using incorrect HTML attributes instead of CSS properties.
- On Web, fix some `WindowBuilder` methods doing nothing. - On Web, fix some `WindowBuilder` methods doing nothing.
- On Web, implement `Window::focus_window()`. - 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 # 0.29.0-beta.0

View file

@ -38,9 +38,6 @@ use web_sys::HtmlCanvasElement;
pub trait WindowExtWebSys { pub trait WindowExtWebSys {
/// Only returns the canvas if called from inside the window. /// Only returns the canvas if called from inside the window.
fn canvas(&self) -> Option<HtmlCanvasElement>; 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 { pub trait WindowBuilderExtWebSys {

View file

@ -55,12 +55,6 @@ impl WindowExtWebSys for Window {
fn canvas(&self) -> Option<HtmlCanvasElement> { fn canvas(&self) -> Option<HtmlCanvasElement> {
self.window.canvas() 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 { pub fn scale_factor(window: &web_sys::Window) -> f64 {