Start work on allowing blocks to be styled
This commit is contained in:
parent
c04151f999
commit
8d1a4a6a24
7 changed files with 232 additions and 96 deletions
|
@ -227,12 +227,19 @@ pub struct EditorStyle {
|
|||
pub line_number_active: Color,
|
||||
pub guest_selections: Vec<SelectionStyle>,
|
||||
pub syntax: Arc<SyntaxTheme>,
|
||||
pub error_color: Color,
|
||||
pub warning_color: Color,
|
||||
pub diagnostic_error: DiagnosticStyle,
|
||||
pub diagnostic_warning: DiagnosticStyle,
|
||||
#[serde(default)]
|
||||
pub information_color: Color,
|
||||
pub diagnostic_information: DiagnosticStyle,
|
||||
#[serde(default)]
|
||||
pub hint_color: Color,
|
||||
pub diagnostic_hint: DiagnosticStyle,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Deserialize, Default)]
|
||||
pub struct DiagnosticStyle {
|
||||
pub text: Color,
|
||||
#[serde(flatten)]
|
||||
pub block: BlockStyle,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Default, Deserialize)]
|
||||
|
@ -251,6 +258,12 @@ pub struct InputEditorStyle {
|
|||
pub selection: SelectionStyle,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Eq)]
|
||||
pub struct BlockStyle {
|
||||
pub background: Option<Color>,
|
||||
pub border: Option<Color>,
|
||||
}
|
||||
|
||||
impl EditorStyle {
|
||||
pub fn placeholder_text(&self) -> &TextStyle {
|
||||
self.placeholder_text.as_ref().unwrap_or(&self.text)
|
||||
|
@ -273,10 +286,10 @@ impl InputEditorStyle {
|
|||
line_number_active: Default::default(),
|
||||
guest_selections: Default::default(),
|
||||
syntax: Default::default(),
|
||||
error_color: Default::default(),
|
||||
warning_color: Default::default(),
|
||||
information_color: Default::default(),
|
||||
hint_color: Default::default(),
|
||||
diagnostic_error: Default::default(),
|
||||
diagnostic_warning: Default::default(),
|
||||
diagnostic_information: Default::default(),
|
||||
diagnostic_hint: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue