Ability to force a theme on Windows (#1666)

This commit is contained in:
Viktor Zoutman 2020-11-30 19:04:26 +01:00 committed by GitHub
parent 5700359a61
commit 6ddee9a8ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 63 additions and 37 deletions

View file

@ -3,7 +3,7 @@ use crate::{
event::ModifiersState,
icon::Icon,
platform_impl::platform::{event_loop, util},
window::{CursorIcon, Fullscreen, WindowAttributes},
window::{CursorIcon, Fullscreen, Theme, WindowAttributes},
};
use parking_lot::MutexGuard;
use std::{io, ptr};
@ -31,7 +31,8 @@ pub struct WindowState {
pub modifiers_state: ModifiersState,
pub fullscreen: Option<Fullscreen>,
pub is_dark_mode: bool,
pub current_theme: Theme,
pub preferred_theme: Option<Theme>,
pub high_surrogate: Option<u16>,
window_flags: WindowFlags,
}
@ -101,7 +102,8 @@ impl WindowState {
attributes: &WindowAttributes,
taskbar_icon: Option<Icon>,
scale_factor: f64,
is_dark_mode: bool,
current_theme: Theme,
preferred_theme: Option<Theme>,
) -> WindowState {
WindowState {
mouse: MouseProperties {
@ -122,7 +124,8 @@ impl WindowState {
modifiers_state: ModifiersState::default(),
fullscreen: None,
is_dark_mode,
current_theme,
preferred_theme,
high_surrogate: None,
window_flags: WindowFlags::empty(),
}