mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 04:26:20 +00:00
feat(history): /history backend command and status-bar indicator
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
|
||||
#include "config/theme.h"
|
||||
#include "config/preferences.h"
|
||||
#include "database.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/statusbar.h"
|
||||
#include "ui/inputwin.h"
|
||||
@@ -83,6 +84,7 @@ static WINDOW* statusbar_win;
|
||||
void _get_range_bounds(int* start, int* end, gboolean is_static);
|
||||
static int _status_bar_draw_time(int pos);
|
||||
static int _status_bar_draw_maintext(int pos);
|
||||
static int _status_bar_draw_dbbackend(int pos);
|
||||
static int _status_bar_draw_bracket(gboolean current, int pos, const char* ch);
|
||||
static int _status_bar_draw_extended_tabs(int pos, gboolean prefix, int start, int end, gboolean is_static);
|
||||
static int _status_bar_draw_tab(StatusBarTab* tab, int pos, int num, gboolean include_brackets);
|
||||
@@ -313,6 +315,7 @@ status_bar_draw(void)
|
||||
|
||||
pos = _status_bar_draw_time(pos);
|
||||
pos = _status_bar_draw_maintext(pos);
|
||||
pos = _status_bar_draw_dbbackend(pos);
|
||||
if (max_tabs != 0)
|
||||
pos = _status_bar_draw_tabs(pos);
|
||||
|
||||
@@ -603,6 +606,17 @@ _status_bar_draw_maintext(int pos)
|
||||
return pos;
|
||||
}
|
||||
|
||||
static int
|
||||
_status_bar_draw_dbbackend(int pos)
|
||||
{
|
||||
if (!active_db_backend || !active_db_backend->name)
|
||||
return pos;
|
||||
|
||||
auto_gchar gchar* label = g_strdup_printf(" [%s]", active_db_backend->name);
|
||||
mvwprintw(statusbar_win, 0, pos, "%s", label);
|
||||
return pos + utf8_display_len(label);
|
||||
}
|
||||
|
||||
static void
|
||||
_destroy_tab(StatusBarTab* tab)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user