mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 13:20:06 -04:00
Rework theme API
This commit adds support for theming on macOS and also unifies the system theme handling across platforms.
This commit is contained in:
@@ -170,7 +170,7 @@ impl Window {
|
||||
// Set CSD frame config from theme if specified,
|
||||
// otherwise use upstream automatic selection.
|
||||
#[cfg(feature = "sctk-adwaita")]
|
||||
if let Some(theme) = platform_attributes.csd_theme.or_else(|| {
|
||||
if let Some(theme) = attributes.preferred_theme.or_else(|| {
|
||||
std::env::var(WAYLAND_CSD_THEME_ENV_VAR)
|
||||
.ok()
|
||||
.and_then(|s| s.as_str().try_into().ok())
|
||||
@@ -619,6 +619,11 @@ impl Window {
|
||||
self.window_requests.lock().unwrap().push(request);
|
||||
self.event_loop_awakener.ping();
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn theme(&self) -> Option<Theme> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Window {
|
||||
|
||||
Reference in New Issue
Block a user