From e5d4ff5c2ae795be35c1a4916541dd9bca7748f0 Mon Sep 17 00:00:00 2001 From: Alexander Zhylin Date: Wed, 6 May 2026 18:22:38 +0300 Subject: [PATCH] ui: box fixes --- TODO.md | 9 +++++++-- src/query.c | 10 +++++----- src/widget/dialogue.c | 4 ++-- src/widget/input.c | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/TODO.md b/TODO.md index b52bcb6..3718ca8 100644 --- a/TODO.md +++ b/TODO.md @@ -1,19 +1,24 @@ # TODO: ## Current: +- [ ] Input: fix non-Latin letters - [ ] Check callback functions in dialogues -- [ ] Check registration / enter server name again + resp_data.code приходит cbrp_val вместо cbrp_none - [ ] Get rid of unsigned integers - [ ] Separate common structures in the common.h -- [ ] Testing - [ ] Sorting in the file list - [ ] File upload multiline description (window) - [ ] More intuitive navigation between nested groups (by pressing left and right buttons) - [ ] Cancel upload/download +- [x] Check registration / enter server name again - [x] PageUp/PageDown key functionality in lists - [x] Permission checkboxes for file upload/edit - [x] Upload menu disappears after alert (when opening link to non-existing directory for example). +## Global tasks: +- [ ] Testing +- [ ] Documentation + ## Bugs: - [ ] Sometimes segfaults while navigating through modal menu diff --git a/src/query.c b/src/query.c index cb61b8f..5b2abd3 100644 --- a/src/query.c +++ b/src/query.c @@ -91,8 +91,8 @@ void query_loop(app_t *app) { } } + /* process request from the server */ if (FD_ISSET(sd, &readfds)) { - /* process request from the server */ qlen = read(sd, query_args->buf, INBUFSIZE); if (qlen == 0) { EXIT_APP("*** server closed the connection ***", app, 1) @@ -105,22 +105,22 @@ void query_loop(app_t *app) { } } + /* process upload/download */ if (query_args->file && query_args->file->fd > -1 && FD_ISSET(query_args->file->fd, &readfds)) { - /* process upload/download */ query_args->buf_used = read(query_args->file->fd, query_args->buf, INBUFSIZE); process_query(app); } if (FD_ISSET(STDIN_FILENO, &readfds)) { - if (app->main_ui.cb_b_press != NULL) { + if (app->main_ui.cb_b_press != NULL && app->modal.is_initiated == false) { if (ERR == app->main_ui.cb_b_press(app, &d_args)) { - EXIT_APP("*** error while processing user input ***", app, 4) + w_alert("error while processing user input"); } } else { if (ERR == process_user_input(app, &d_args)) { - EXIT_APP("*** error while processing user input ***", app, 4) + w_alert("error while processing user input"); } } } diff --git a/src/widget/dialogue.c b/src/widget/dialogue.c index 6349829..aa1bb55 100644 --- a/src/widget/dialogue.c +++ b/src/widget/dialogue.c @@ -248,10 +248,10 @@ int32_t w_dialogue_draw(w_dialogue_t *d) { switch (d->color_scheme) { case dc_normal: - wattrset(d->win, COLOR_PAIR(0) | A_BOLD | A_REVERSE); + wattrset(d->win, COLOR_PAIR(0) | A_REVERSE); break; case dc_alert: - wattrset(d->win, COLOR_PAIR(4) | A_BOLD | A_REVERSE); + wattrset(d->win, COLOR_PAIR(4) | A_REVERSE); break; } diff --git a/src/widget/input.c b/src/widget/input.c index c165ca9..753044f 100644 --- a/src/widget/input.c +++ b/src/widget/input.c @@ -80,9 +80,9 @@ int32_t w_input_draw(w_input_t *input, uint32_t active_id) { } if (input->w.id == active_id) { - wattrset(win, COLOR_PAIR(3)); + wattrset(win, COLOR_PAIR(3) | A_BOLD); } else { - wattrset(win, COLOR_PAIR(0) | A_REVERSE | A_BOLD); + wattrset(win, COLOR_PAIR(0) | A_REVERSE); } mvwhline(win, pos_y, pos_x, 0, input->w.sz.x);