Skip to main content

ui/styles/
appearance.rs

1use crate::prelude::*;
2use gpui::{App, WindowBackgroundAppearance};
3
4/// Returns the [WindowBackgroundAppearance].
5fn window_appearance(cx: &mut App) -> WindowBackgroundAppearance {
6    cx.theme().styles.window_background_appearance
7}
8
9/// Returns if the window and it's surfaces are expected
10/// to be transparent.
11///
12/// Helps determine if you need to take extra steps to prevent
13/// transparent backgrounds.
14pub fn theme_is_transparent(cx: &mut App) -> bool {
15    matches!(
16        window_appearance(cx),
17        WindowBackgroundAppearance::Transparent | WindowBackgroundAppearance::Blurred
18    )
19}