mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-04-20 11:35:48 +00:00
fix: set vte text color at startup
This commit is contained in:
parent
b93afb62e9
commit
b954e20cf2
1 changed files with 12 additions and 7 deletions
|
@ -181,13 +181,7 @@ impl SimpleComponent for DebugView {
|
|||
self.vte_terminal.feed("\x1bc".as_bytes());
|
||||
}
|
||||
Self::Input::SetColorScheme => {
|
||||
if adw::StyleManager::default().is_dark() {
|
||||
self.vte_terminal
|
||||
.set_color_foreground(>k::gdk::RGBA::new(1.0, 1.0, 1.0, 1.0));
|
||||
} else {
|
||||
self.vte_terminal
|
||||
.set_color_foreground(>k::gdk::RGBA::new(0.0, 0.0, 0.0, 1.0));
|
||||
}
|
||||
Self::set_color_scheme(&self.vte_terminal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -239,6 +233,7 @@ impl SimpleComponent for DebugView {
|
|||
.build();
|
||||
t.set_clear_background(false);
|
||||
t.search_set_wrap_around(true);
|
||||
Self::set_color_scheme(&t);
|
||||
t
|
||||
},
|
||||
};
|
||||
|
@ -274,3 +269,13 @@ impl SimpleComponent for DebugView {
|
|||
ComponentParts { model, widgets }
|
||||
}
|
||||
}
|
||||
|
||||
impl DebugView {
|
||||
fn set_color_scheme(term: &Terminal) {
|
||||
if adw::StyleManager::default().is_dark() {
|
||||
term.set_color_foreground(>k::gdk::RGBA::new(1.0, 1.0, 1.0, 1.0));
|
||||
} else {
|
||||
term.set_color_foreground(>k::gdk::RGBA::new(0.0, 0.0, 0.0, 1.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue