stevenkhan commited on
Commit
49a519f
·
verified ·
1 Parent(s): 01f464e

Upload spectral-core/src/config.rs

Browse files
Files changed (1) hide show
  1. spectral-core/src/config.rs +62 -0
spectral-core/src/config.rs ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /// Terminal configuration — matches Ghostty key options where relevant.
2
+ #[derive(Clone, Debug)]
3
+ pub struct Config {
4
+ pub cols: usize,
5
+ pub rows: usize,
6
+ pub scrollback_limit: usize,
7
+ pub font_family: String,
8
+ pub font_size: f32,
9
+ pub font_thicken: bool,
10
+ pub font_thicken_strength: f32,
11
+ pub font_feature: Vec<String>,
12
+ pub font_variation: Vec<(String, f32)>,
13
+ pub adjust_cell_height: Option<f32>,
14
+ pub adjust_cell_width: Option<f32>,
15
+ pub adjust_font_baseline: Option<f32>,
16
+ pub cursor_style: CursorStyle,
17
+ pub cursor_blink: bool,
18
+ pub foreground_color: u32,
19
+ pub background_color: u32,
20
+ pub selection_color: u32,
21
+ pub mouse_scroll_multiplier: f32,
22
+ pub repaint_delay_ms: u32,
23
+ pub input_delay_ms: u32,
24
+ pub vsync: bool,
25
+ pub opacity: f32,
26
+ }
27
+
28
+ impl Default for Config {
29
+ fn default() -> Self {
30
+ Self {
31
+ cols: 80,
32
+ rows: 24,
33
+ scrollback_limit: 100_000,
34
+ font_family: "Iosevka Extended".to_string(),
35
+ font_size: 13.0,
36
+ font_thicken: false,
37
+ font_thicken_strength: 0.5,
38
+ font_feature: Vec::new(),
39
+ font_variation: Vec::new(),
40
+ adjust_cell_height: None,
41
+ adjust_cell_width: None,
42
+ adjust_font_baseline: None,
43
+ cursor_style: CursorStyle::Block,
44
+ cursor_blink: true,
45
+ foreground_color: 0xFF_E5E5E5,
46
+ background_color: 0xFF_000000,
47
+ selection_color: 0xFF_264F78,
48
+ mouse_scroll_multiplier: 1.0,
49
+ repaint_delay_ms: 0,
50
+ input_delay_ms: 0,
51
+ vsync: false,
52
+ opacity: 1.0,
53
+ }
54
+ }
55
+ }
56
+
57
+ #[derive(Clone, Copy, Debug, PartialEq, Eq)]
58
+ pub enum CursorStyle {
59
+ Block,
60
+ Beam,
61
+ Underline,
62
+ }