Skip to main content

gpui_types/
style.rs

1//! Style primitives shared between GPUI and its platform backends.
2
3use crate::{Hsla, Pixels};
4use refineable::Refineable;
5use schemars::JsonSchema;
6use serde::{Deserialize, Serialize};
7
8/// The properties that can be applied to an underline.
9#[derive(
10    Refineable, Copy, Clone, Default, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema,
11)]
12pub struct UnderlineStyle {
13    /// The thickness of the underline.
14    pub thickness: Pixels,
15
16    /// The color of the underline.
17    pub color: Option<Hsla>,
18
19    /// Whether the underline should be wavy, like in a spell checker.
20    pub wavy: bool,
21}
22
23/// The properties that can be applied to a strikethrough.
24#[derive(
25    Refineable, Copy, Clone, Default, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema,
26)]
27pub struct StrikethroughStyle {
28    /// The thickness of the strikethrough.
29    pub thickness: Pixels,
30
31    /// The color of the strikethrough.
32    pub color: Option<Hsla>,
33}