aboutsummaryrefslogtreecommitdiff
path: root/client/ui.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-06 16:48:29 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-06 16:48:29 +0200
commita909440c7671075127a98cffd7f1714114fc17bd (patch)
treee39ea84db612d7293c0011a23965b94026ce4337 /client/ui.c
parent6f4f05707740e43182317eb6d3d69a43f52815b2 (diff)
use pads for body and tab bar
Diffstat (limited to 'client/ui.c')
-rw-r--r--client/ui.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/client/ui.c b/client/ui.c
index 3835126..7731215 100644
--- a/client/ui.c
+++ b/client/ui.c
@@ -11,11 +11,23 @@
#include "ui.h"
WINDOW *g_w2_ui_win;
+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;
+void w2_wmvaddstr(WINDOW *win, unsigned int y, unsigned int x, char *str) {
+ wmove(win, y, x);
+ waddstr(win, str);
+}
+
+void w2_wmvaddnstr(WINDOW *win, unsigned int y, unsigned int x, char *str, unsigned int len) {
+ wmove(win, y, x);
+ waddnstr(win, str, len);
+}
+
void w2_ui_main() {
g_w2_ui_width = getmaxx(g_w2_ui_win);
g_w2_ui_height = getmaxy(g_w2_ui_win);
@@ -30,7 +42,9 @@ void w2_ui_paint() {
g_w2_ui_last_tab = g_w2_ui_current_tab;
w2_timer_start(W2_TIMER_UPDATE);
}
- refresh();
+ prefresh(g_w2_ui_pad_tabbar, 0, 0, 2, 0, 2, g_w2_ui_width - 1);
+ prefresh(g_w2_ui_pad_body, 0, 0, 4, 0, g_w2_ui_height - 2, g_w2_ui_width - 1);
+ // wrefresh(g_w2_ui_win);
}
void w2_ui_paint_statusbar() {
@@ -67,5 +81,5 @@ void w2_ui_paint_statusbar() {
void w2_ui_paint_tabbar() {
char temp[g_w2_ui_width];
sprintf(temp, "-- tab bar here --");
- mvaddstr(2, g_w2_ui_width / 2 - strlen(temp) / 2, temp);
+ w2_wmvaddstr(g_w2_ui_pad_tabbar, 0, g_w2_ui_width / 2 - strlen(temp) / 2, temp);
}