summaryrefslogtreecommitdiff
path: root/client/ui_tabbar.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_tabbar.c
parenta909440c7671075127a98cffd7f1714114fc17bd (diff)
code organization
Diffstat (limited to 'client/ui_tabbar.c')
-rw-r--r--client/ui_tabbar.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/client/ui_tabbar.c b/client/ui_tabbar.c
new file mode 100644
index 0000000..fc43db9
--- /dev/null
+++ b/client/ui_tabbar.c
@@ -0,0 +1,25 @@
+#include <stdlib.h>
+#include <string.h>
+
+#include "ui.h"
+
+unsigned int g_w2_ui_tabbar_scroll = 0;
+unsigned int g_w2_ui_tabbar_lengths[W2_UI_TAB_COUNT];
+void (*g_w2_tab_ptrs[W2_UI_TAB_COUNT])(bool first);
+
+void w2_ui_tabbar_init() {
+ g_w2_tab_ptrs[W2_UI_TAB_START] = &w2_ui_tab_start;
+ g_w2_tab_ptrs[W2_UI_TAB_DIRC] = &w2_ui_tab_dirc;
+}
+
+char* w2_ui_tabbar_format_tab(char* name, bool selected) {
+ char* ret_val = malloc(strlen(name) + 3);
+ printf("%c%s%c", selected ? '[' : ' ', name, selected ? ']' : ' ');
+ return ret_val;
+}
+
+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);
+}