mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-01 21:58:43 +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.vte_terminal.feed("\x1bc".as_bytes());
|
||||||
}
|
}
|
||||||
Self::Input::SetColorScheme => {
|
Self::Input::SetColorScheme => {
|
||||||
if adw::StyleManager::default().is_dark() {
|
Self::set_color_scheme(&self.vte_terminal);
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,6 +233,7 @@ impl SimpleComponent for DebugView {
|
||||||
.build();
|
.build();
|
||||||
t.set_clear_background(false);
|
t.set_clear_background(false);
|
||||||
t.search_set_wrap_around(true);
|
t.search_set_wrap_around(true);
|
||||||
|
Self::set_color_scheme(&t);
|
||||||
t
|
t
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -274,3 +269,13 @@ impl SimpleComponent for DebugView {
|
||||||
ComponentParts { model, widgets }
|
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
Add a link
Reference in a new issue