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