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:
parent
4f06cfcf5b
commit
92fdf5ba85
20 changed files with 256 additions and 60 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue