mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-03 06:38:52 +00:00
feat: don't overwrite the entire build textbuf content on each tick
This commit is contained in:
parent
d225b65222
commit
ff744853b6
2 changed files with 14 additions and 6 deletions
|
@ -82,8 +82,10 @@ impl RunnerPipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_log(&self) -> String {
|
pub fn get_log(&mut self) -> Vec<String> {
|
||||||
self.log.concat()
|
let log = self.log.to_owned();
|
||||||
|
self.log = vec![];
|
||||||
|
log
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn status(&self) -> RunnerStatus {
|
pub fn status(&self) -> RunnerStatus {
|
||||||
|
|
|
@ -30,7 +30,7 @@ pub enum BuildWindowMsg {
|
||||||
Present,
|
Present,
|
||||||
UpdateTitle(String),
|
UpdateTitle(String),
|
||||||
UpdateBuildStatus(BuildStatus),
|
UpdateBuildStatus(BuildStatus),
|
||||||
UpdateContent(String),
|
UpdateContent(Vec<String>),
|
||||||
UpdateCanClose(bool),
|
UpdateCanClose(bool),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,9 +134,15 @@ impl SimpleComponent for BuildWindow {
|
||||||
self.set_title(t);
|
self.set_title(t);
|
||||||
}
|
}
|
||||||
Self::Input::UpdateContent(c) => {
|
Self::Input::UpdateContent(c) => {
|
||||||
if self.content != c {
|
if c.len() > 0 {
|
||||||
self.set_content(c);
|
let n_lines = c.concat();
|
||||||
self.textbuf.set_text(&self.content);
|
let mut n_content = self.content.clone();
|
||||||
|
n_content.push_str(n_lines.as_str());
|
||||||
|
self.set_content(n_content);
|
||||||
|
self.textbuf.insert(
|
||||||
|
&mut self.textbuf.end_iter(),
|
||||||
|
n_lines.as_str()
|
||||||
|
);
|
||||||
let textbuf = self.textbuf.clone();
|
let textbuf = self.textbuf.clone();
|
||||||
let textview = self.textview.as_ref().unwrap().clone();
|
let textview = self.textview.as_ref().unwrap().clone();
|
||||||
gtk::glib::idle_add_local_once(move || {
|
gtk::glib::idle_add_local_once(move || {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue