summaryrefslogtreecommitdiff
path: root/client/ui.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-06 18:32:04 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-06 18:32:04 +0200
commit8c1d31ef16745cee07059788386cd88c718092ac (patch)
treee944221ef69f38393790e337e85eb9edfe17a559 /client/ui.c
parenta909440c7671075127a98cffd7f1714114fc17bd (diff)
code organization
Diffstat (limited to 'client/ui.c')
-rw-r--r--client/ui.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/client/ui.c b/client/ui.c
index 7731215..a1d15ad 100644
--- a/client/ui.c
+++ b/client/ui.c
@@ -15,8 +15,8 @@ WINDOW *g_w2_ui_pad_tabbar;
WINDOW *g_w2_ui_pad_body;
unsigned int g_w2_ui_width = 0;
unsigned int g_w2_ui_height = 0;
-void (*g_w2_ui_current_tab)(bool first) = &w2_ui_dirc;
-void (*g_w2_ui_last_tab)(bool first) = NULL;
+w2_e_ui_tab g_w2_ui_current_tab = W2_UI_TAB_START;
+w2_e_ui_tab g_w2_ui_last_tab;
void w2_wmvaddstr(WINDOW *win, unsigned int y, unsigned int x, char *str) {
wmove(win, y, x);
@@ -38,7 +38,7 @@ void w2_ui_main() {
void w2_ui_paint() {
w2_ui_paint_statusbar();
if (w2_timer_end(W2_TIMER_UPDATE) >= (1000 / W2_UI_UPDATE_FPS)) {
- (*g_w2_ui_current_tab)(g_w2_ui_last_tab != g_w2_ui_current_tab);
+ (*g_w2_tab_ptrs[g_w2_ui_current_tab])(g_w2_ui_last_tab != g_w2_ui_current_tab);
g_w2_ui_last_tab = g_w2_ui_current_tab;
w2_timer_start(W2_TIMER_UPDATE);
}
@@ -78,8 +78,3 @@ void w2_ui_paint_statusbar() {
mvaddnstr(3, 0, temp, g_w2_ui_width);
}
-void w2_ui_paint_tabbar() {
- char temp[g_w2_ui_width];
- sprintf(temp, "-- tab bar here --");
- w2_wmvaddstr(g_w2_ui_pad_tabbar, 0, g_w2_ui_width / 2 - strlen(temp) / 2, temp);
-}