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:
keiya sasaki 2022-10-19 03:34:36 +09:00 committed by GitHub
parent 4f06cfcf5b
commit 92fdf5ba85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 256 additions and 60 deletions

View file

@ -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 {