summaryrefslogtreecommitdiff
path: root/src/fruits/cmc/ui/widgets
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-04-30 10:08:46 -0400
committerAndrew Opalach <andrew@akon.city> 2025-04-30 10:08:46 -0400
commitaf54e6510f2f701db3b3a533514076c04cea4c66 (patch)
tree1645cb74d8892fd3be38597353a7b0309c92531d /src/fruits/cmc/ui/widgets
parent44ef9e89b2674af720cb89299df1f3938b9d8fb2 (diff)
downloadcamu-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/widgets')
-rw-r--r--src/fruits/cmc/ui/widgets/now_playing.c7
-rw-r--r--src/fruits/cmc/ui/widgets/now_playing.h1
-rw-r--r--src/fruits/cmc/ui/widgets/tile.h11
3 files changed, 18 insertions, 1 deletions
diff --git a/src/fruits/cmc/ui/widgets/now_playing.c b/src/fruits/cmc/ui/widgets/now_playing.c
index 845a572..ebb8361 100644
--- a/src/fruits/cmc/ui/widgets/now_playing.c
+++ b/src/fruits/cmc/ui/widgets/now_playing.c
@@ -80,6 +80,13 @@ void cmc_now_playing_erase(struct cmc_now_playing *np)
ncplane_erase(np->n);
}
+void cmc_now_playing_clear(struct cmc_now_playing *np)
+{
+ cmc_now_playing_erase(np);
+ ncplane_erase(np->wave);
+ np->blitted = NULL;
+}
+
void cmc_now_playing_render(struct cmc_now_playing *np, struct cmc_list_entry *entry)
{
u64 duration = 0, pos = 0;
diff --git a/src/fruits/cmc/ui/widgets/now_playing.h b/src/fruits/cmc/ui/widgets/now_playing.h
index 5993c59..5c89940 100644
--- a/src/fruits/cmc/ui/widgets/now_playing.h
+++ b/src/fruits/cmc/ui/widgets/now_playing.h
@@ -22,4 +22,5 @@ void cmc_now_playing_init(struct cmc_now_playing *np);
bool cmc_now_playing_layout(struct cmc_now_playing *np, struct ncplane *parent, u32 y);
bool cmc_now_playing_tick(struct cmc_now_playing *np, struct cmc_list_entry *entry);
void cmc_now_playing_erase(struct cmc_now_playing *np);
+void cmc_now_playing_clear(struct cmc_now_playing *np);
void cmc_now_playing_render(struct cmc_now_playing *np, struct cmc_list_entry *entry);
diff --git a/src/fruits/cmc/ui/widgets/tile.h b/src/fruits/cmc/ui/widgets/tile.h
index 6f15c7d..a410207 100644
--- a/src/fruits/cmc/ui/widgets/tile.h
+++ b/src/fruits/cmc/ui/widgets/tile.h
@@ -1,5 +1,14 @@
#pragma once
-struct cmc_tile {
+/*
+ Use-case examples:
+ - Twitter timeline type.
+ - Image grid (static/dynamic size, with or without title).
+
+ Implementation:
+ - Tile sets it's own size.
+ - Reel.
+*/
+struct cmc_tile {
};