perf improvement when fullscreen popup open

do not render tabs when fullscreen popup open
This commit is contained in:
Stephan Dilly 2022-01-30 23:00:00 +01:00
parent ef78a3a8ba
commit 194fa6f2e7

View File

@ -308,15 +308,26 @@ impl App {
self.draw_tabs(f, chunks_main[0]);
//TODO: macro because of generic draw call
match self.tab {
0 => self.status_tab.draw(f, chunks_main[1])?,
1 => self.revlog.draw(f, chunks_main[1])?,
2 => self.files_tab.draw(f, chunks_main[1])?,
3 => self.stashing_tab.draw(f, chunks_main[1])?,
4 => self.stashlist_tab.draw(f, chunks_main[1])?,
_ => bail!("unknown tab"),
};
//TODO: component property + a macro `fullscreen_popup_open!`
// to make this scale better?
let fullscreen_popup_open =
self.revision_files_popup.is_visible()
|| self.inspect_commit_popup.is_visible()
|| self.compare_commits_popup.is_visible()
|| self.blame_file_popup.is_visible()
|| self.file_revlog_popup.is_visible();
if !fullscreen_popup_open {
//TODO: macro because of generic draw call
match self.tab {
0 => self.status_tab.draw(f, chunks_main[1])?,
1 => self.revlog.draw(f, chunks_main[1])?,
2 => self.files_tab.draw(f, chunks_main[1])?,
3 => self.stashing_tab.draw(f, chunks_main[1])?,
4 => self.stashlist_tab.draw(f, chunks_main[1])?,
_ => bail!("unknown tab"),
};
}
self.draw_popups(f)?;