diff options
| author | 2025-04-30 10:08:46 -0400 | |
|---|---|---|
| committer | 2025-04-30 10:08:46 -0400 | |
| commit | af54e6510f2f701db3b3a533514076c04cea4c66 (patch) | |
| tree | 1645cb74d8892fd3be38597353a7b0309c92531d /src/fruits/cmc/ui/panes | |
| parent | 44ef9e89b2674af720cb89299df1f3938b9d8fb2 (diff) | |
| download | camu-af54e6510f2f701db3b3a533514076c04cea4c66.tar.gz camu-af54e6510f2f701db3b3a533514076c04cea4c66.tar.bz2 camu-af54e6510f2f701db3b3a533514076c04cea4c66.zip | |
Separate erasing for re-render and clearing in tui
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/fruits/cmc/ui/panes')
| -rw-r--r-- | src/fruits/cmc/ui/panes/list.c | 6 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/panes/list.h | 2 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/panes/log.c | 4 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/panes/log.h | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/src/fruits/cmc/ui/panes/list.c b/src/fruits/cmc/ui/panes/list.c index 0e853db..34e18f9 100644 --- a/src/fruits/cmc/ui/panes/list.c +++ b/src/fruits/cmc/ui/panes/list.c @@ -220,10 +220,10 @@ bool cmc_list_pane_tick(struct cmc_list_pane *lp) return tick; } -void cmc_list_pane_erase(struct cmc_list_pane *lp) +void cmc_list_pane_clear(struct cmc_list_pane *lp) { ncplane_erase(lp->n); - cmc_now_playing_erase(&lp->np); + cmc_now_playing_clear(&lp->np); } static void render_list_entries(struct cmc_list_pane *lp, struct cmc_list_tab *tab, s32 max_height) @@ -283,6 +283,8 @@ static void render_list_entries(struct cmc_list_pane *lp, struct cmc_list_tab *t void cmc_list_pane_render(struct cmc_list_pane *lp) { + ncplane_erase(lp->n); + cmc_now_playing_erase(&lp->np); if (lp->selected == -1) return; struct cmc_list_tab *tab = &al_array_at(lp->tabs, lp->selected); render_list_entries(lp, tab, lp->page_length); diff --git a/src/fruits/cmc/ui/panes/list.h b/src/fruits/cmc/ui/panes/list.h index bfeed59..3fb10f9 100644 --- a/src/fruits/cmc/ui/panes/list.h +++ b/src/fruits/cmc/ui/panes/list.h @@ -31,5 +31,5 @@ bool cmc_list_pane_layout(struct cmc_list_pane *lp, struct ncplane *parent); void cmc_list_pane_add_list(struct cmc_list_pane *lp, struct cmc_list *list); bool cmc_list_pane_handle_input(struct cmc_list_pane *lp, struct ncinput *input); bool cmc_list_pane_tick(struct cmc_list_pane *lp); -void cmc_list_pane_erase(struct cmc_list_pane *lp); +void cmc_list_pane_clear(struct cmc_list_pane *lp); void cmc_list_pane_render(struct cmc_list_pane *lp); diff --git a/src/fruits/cmc/ui/panes/log.c b/src/fruits/cmc/ui/panes/log.c index be9702c..370e91a 100644 --- a/src/fruits/cmc/ui/panes/log.c +++ b/src/fruits/cmc/ui/panes/log.c @@ -38,7 +38,7 @@ bool cmc_log_pane_tick(struct cmc_log_pane *lp) return false; } -void cmc_log_pane_erase(struct cmc_log_pane *lp) +void cmc_log_pane_clear(struct cmc_log_pane *lp) { ncplane_erase(lp->n); } @@ -47,6 +47,8 @@ void cmc_log_pane_render(struct cmc_log_pane *lp) { struct ncplane *n = lp->n; + ncplane_erase(n); + u32 max_height = ncplane_dim_y(n); u32 count = lp->messages.count; diff --git a/src/fruits/cmc/ui/panes/log.h b/src/fruits/cmc/ui/panes/log.h index d79c7e9..b647c89 100644 --- a/src/fruits/cmc/ui/panes/log.h +++ b/src/fruits/cmc/ui/panes/log.h @@ -14,5 +14,5 @@ bool cmc_log_pane_layout(struct cmc_log_pane *lp, struct ncplane *parent); void cmc_log_pane_push_message(struct cmc_log_pane *lp, char *message); bool cmc_log_pane_handle_input(struct cmc_log_pane *lp, struct ncinput *input); bool cmc_log_pane_tick(struct cmc_log_pane *lp); -void cmc_log_pane_erase(struct cmc_log_pane *lp); +void cmc_log_pane_clear(struct cmc_log_pane *lp); void cmc_log_pane_render(struct cmc_log_pane *lp); |