feat: add different background color for inactive panes

pull/7988/head
Ben LeFevre 1 year ago
parent a7651f5bf0
commit 7ffb76af21

@ -269,6 +269,7 @@ These scopes are used for theming the editor interface:
| Key | Notes | | Key | Notes |
| --- | --- | | --- | --- |
| `ui.background` | | | `ui.background` | |
| `ui.background.inactive` | Background of unfocused document |
| `ui.background.separator` | Picker separator below input line | | `ui.background.separator` | Picker separator below input line |
| `ui.cursor` | | | `ui.cursor` | |
| `ui.cursor.normal` | | | `ui.cursor.normal` | |

@ -98,6 +98,10 @@ impl EditorView {
let text_annotations = view.text_annotations(doc, Some(theme)); let text_annotations = view.text_annotations(doc, Some(theme));
let mut decorations = DecorationManager::default(); let mut decorations = DecorationManager::default();
if !is_focused {
surface.set_style(area, theme.get("ui.background.inactive"))
}
if is_focused && config.cursorline { if is_focused && config.cursorline {
decorations.add_decoration(Self::cursorline(doc, view, theme)); decorations.add_decoration(Self::cursorline(doc, view, theme));
} }

Loading…
Cancel
Save