freya_core/style/
cursor.rs1#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3#[derive(Default, Debug, Copy, Clone, Hash, PartialEq, Eq)]
4pub enum CursorStyle {
5 #[default]
7 Line = 0,
8 Block = 1,
10 Underline = 2,
12}
13
14impl CursorStyle {
15 pub fn pretty(&self) -> String {
16 match self {
17 Self::Line => "line".to_string(),
18 Self::Block => "block".to_string(),
19 Self::Underline => "underline".to_string(),
20 }
21 }
22}
23
24#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
26#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
27pub enum CursorMode {
28 #[default]
31 Fit,
32 Expanded,
35}
36
37impl CursorMode {
38 pub fn pretty(&self) -> String {
39 match self {
40 Self::Fit => "fit".to_string(),
41 Self::Expanded => "expanded".to_string(),
42 }
43 }
44}