mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 01:18:21 +00:00
perf improvement when fullscreen popup open
do not render tabs when fullscreen popup open
This commit is contained in:
parent
ef78a3a8ba
commit
194fa6f2e7
1 changed files with 20 additions and 9 deletions
29
src/app.rs
29
src/app.rs
|
|
@ -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)?;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue