ui: alert; anonymous login; registration (not finished)

This commit is contained in:
2026-02-18 18:39:47 +02:00
parent f9fc9e0167
commit e2750799c5
15 changed files with 188 additions and 7 deletions
+1
View File
@@ -73,6 +73,7 @@ void init_nc() {
init_pair(1, COLOR_RED, COLOR_BLACK);
init_pair(2, COLOR_GREEN, COLOR_BLACK);
init_pair(modal_color_pair, COLOR_BLUE, COLOR_WHITE);
init_pair(4, COLOR_CYAN, COLOR_WHITE);
}
}
-1
View File
@@ -28,7 +28,6 @@ typedef struct {
coordinates_t coordinates;
query_args_t *query_args;
file_args_t *file_args;
int32_t read_fd;
active_win_t active_win_type;
void (*active_callback)(callback_args_t *args);
WINDOW *active_win;
+9 -1
View File
@@ -173,6 +173,7 @@ void init_dialogue(dialogue_t *dialogue, const char title[], const char text[],
dialogue->is_initiated = true;
dialogue->needs_update = true;
dialogue->needs_destroy = false;
dialogue->color_scheme = dc_normal;
strcpy(dialogue->w.title, title);
strcpy(dialogue->text, text);
}
@@ -284,7 +285,14 @@ int32_t draw_dialogue(dialogue_t *d) {
d->win = newwin(y, x, d->w.m_y, d->w.m_x);
}
wattrset(d->win, COLOR_PAIR(0) | A_BOLD | A_REVERSE);
switch (d->color_scheme) {
case dc_normal:
wattrset(d->win, COLOR_PAIR(0) | A_BOLD | A_REVERSE);
break;
case dc_alert:
wattrset(d->win, COLOR_PAIR(4) | A_BOLD | A_REVERSE);
break;
}
/* background */
for (int yp = 1; yp < d->w.y - 1; yp++) {
+3 -1
View File
@@ -8,6 +8,7 @@
#include <widget_core.h>
enum g_type { g_content, g_action };
enum d_color_scheme { dc_normal, dc_alert };
typedef struct {
widget_t w;
@@ -21,8 +22,9 @@ typedef struct {
char text[DIALOGUE_TEXT];
uint32_t is_initiated : 1;
uint32_t needs_update : 1;
uint32_t needs_destroy: 1;
uint32_t needs_destroy : 1;
coordinates_t *p_coordinates;
enum d_color_scheme color_scheme;
} dialogue_t;
void init_dialogue(dialogue_t *d, const char title[], const char text[],