Add support for Windows Dark Mode (#1217)
* Add support for Windows Dark Mode * Add is_dark_mode() getter to WindowExtWindows * Add WindowEvent::DarkModeChanged * Add support for dark mode in Windows 10 builds > 18362 * Change strategy for querying windows 10 build version * Drop window state before sending event Co-Authored-By: daxpedda <daxpedda@gmail.com> * Change implementation of windows dark mode support * Expand supported range of windows 10 versions with dark mode * Use get_function! macro where possible * Minor style fixes * Improve documentation for ThemeChanged * Use `as` conversion for `BOOL` * Correct CHANGELOG entry for dark mode Co-authored-by: daxpedda <daxpedda@gmail.com> Co-authored-by: Osspial <osspial@gmail.com>
This commit is contained in:
parent
25e018d1ce
commit
d59eec4633
10 changed files with 287 additions and 2 deletions
10
src/event.rs
10
src/event.rs
|
|
@ -10,7 +10,7 @@ use std::path::PathBuf;
|
|||
use crate::{
|
||||
dpi::{LogicalPosition, LogicalSize},
|
||||
platform_impl,
|
||||
window::WindowId,
|
||||
window::{Theme, WindowId},
|
||||
};
|
||||
|
||||
/// Describes a generic event.
|
||||
|
|
@ -222,6 +222,14 @@ pub enum WindowEvent {
|
|||
///
|
||||
/// For more information about DPI in general, see the [`dpi`](crate::dpi) module.
|
||||
HiDpiFactorChanged(f64),
|
||||
|
||||
/// The system window theme has changed.
|
||||
///
|
||||
/// Applications might wish to react to this to change the theme of the content of the window
|
||||
/// when the system changes the window theme.
|
||||
///
|
||||
/// At the moment this is only supported on Windows.
|
||||
ThemeChanged(Theme),
|
||||
}
|
||||
|
||||
/// Identifier of an input device.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue