ui: alert; anonymous login; registration (not finished)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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[],
|
||||
|
||||
Reference in New Issue
Block a user