forked from reya/gpui-native-kit
feat: add native material backgrounds
This commit is contained in:
@@ -14,13 +14,13 @@ mod resolve;
|
||||
mod source;
|
||||
mod system;
|
||||
|
||||
pub use colors::ColorTokens;
|
||||
pub use colors::{ColorTokens, MaterialTokens};
|
||||
pub use definition::ThemeDefinition;
|
||||
pub use ramps::{AccentShades, Oklch};
|
||||
pub use resolve::{Ramps, ResolvedTheme};
|
||||
pub use system::{AccessibilityPreferences, PartialPalette, SourceKind, SystemTheme};
|
||||
|
||||
use gpui::{App, Global, Hsla, Pixels, WindowAppearance, px};
|
||||
use gpui::{App, Global, Hsla, Pixels, WindowAppearance, WindowBackgroundAppearance, px};
|
||||
use std::time::Duration;
|
||||
|
||||
/// The hairline width of the control border every button and field paints;
|
||||
@@ -50,6 +50,8 @@ impl ThemeVariant {
|
||||
pub struct Theme {
|
||||
pub variant: ThemeVariant,
|
||||
pub colors: ColorTokens,
|
||||
/// The translucent paints over the window's native material.
|
||||
pub material: MaterialTokens,
|
||||
pub ramps: Ramps,
|
||||
pub radius: Radius,
|
||||
/// Per-platform border and focus chrome.
|
||||
@@ -68,6 +70,8 @@ pub struct Theme {
|
||||
pub mono_font: &'static str,
|
||||
pub sizes: SizeTable,
|
||||
pub accessibility: AccessibilityPreferences,
|
||||
/// The material a window should open with, after accessibility.
|
||||
pub window_background: WindowBackgroundAppearance,
|
||||
}
|
||||
|
||||
impl Global for Theme {}
|
||||
@@ -524,6 +528,7 @@ impl Theme {
|
||||
Self {
|
||||
variant: resolved.variant,
|
||||
colors: resolved.colors,
|
||||
material: resolved.material,
|
||||
ramps: resolved.ramps,
|
||||
radius: resolved.radius,
|
||||
borders: resolved.borders,
|
||||
@@ -536,6 +541,7 @@ impl Theme {
|
||||
mono_font: resolved.mono_font,
|
||||
sizes: resolved.sizes,
|
||||
accessibility: resolved.accessibility,
|
||||
window_background: resolved.window_background,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user