Configurable app_theme

This commit is contained in:
Jeremy Soller 2023-11-13 09:08:31 -07:00
parent 5032f74356
commit 7170e64f4a
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
4 changed files with 122 additions and 59 deletions

View file

@ -24,12 +24,7 @@ impl Tab {
Shaping::Advanced,
);
let editor = SyntaxEditor::new(
buffer,
&SYNTAX_SYSTEM,
config.syntax_theme(cosmic::theme::is_dark()),
)
.unwrap();
let editor = SyntaxEditor::new(buffer, &SYNTAX_SYSTEM, config.syntax_theme()).unwrap();
let mut tab = Self {
path_opt: None,
@ -54,11 +49,7 @@ impl Tab {
Wrap::None
});
//TODO: dynamically discover light/dark changes
editor.update_theme(if cosmic::theme::is_dark() {
&config.syntax_theme_dark
} else {
&config.syntax_theme_light
});
editor.update_theme(config.syntax_theme());
}
pub fn open(&mut self, path: PathBuf) {