1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Inlined status_bar_update_time

This commit is contained in:
James Booth 2014-04-06 01:14:21 +01:00
parent 4248b61a0c
commit c9d28b6999

View File

@ -48,7 +48,6 @@ static int dirty;
static GDateTime *last_time; static GDateTime *last_time;
static int current; static int current;
static void _status_bar_update_time(void);
static void _update_win_statuses(void); static void _update_win_statuses(void);
static void _mark_new(int num); static void _mark_new(int num);
static void _mark_active(int num); static void _mark_active(int num);
@ -98,7 +97,18 @@ _status_bar_update_virtual(void)
} }
if (dirty) { if (dirty) {
_status_bar_update_time(); gchar *date_fmt = g_date_time_format(last_time, "%H:%M");
assert(date_fmt != NULL);
wattron(status_bar, COLOUR_STATUS_BRACKET);
mvwaddch(status_bar, 0, 1, '[');
wattroff(status_bar, COLOUR_STATUS_BRACKET);
mvwprintw(status_bar, 0, 2, date_fmt);
wattron(status_bar, COLOUR_STATUS_BRACKET);
mvwaddch(status_bar, 0, 7, ']');
wattroff(status_bar, COLOUR_STATUS_BRACKET);
g_free(date_fmt);
_update_win_statuses(); _update_win_statuses();
wnoutrefresh(status_bar); wnoutrefresh(status_bar);
inp_put_back(); inp_put_back();
@ -340,25 +350,6 @@ _status_bar_clear_message(void)
dirty = TRUE; dirty = TRUE;
} }
static void
_status_bar_update_time(void)
{
gchar *date_fmt = g_date_time_format(last_time, "%H:%M");
assert(date_fmt != NULL);
wattron(status_bar, COLOUR_STATUS_BRACKET);
mvwaddch(status_bar, 0, 1, '[');
wattroff(status_bar, COLOUR_STATUS_BRACKET);
mvwprintw(status_bar, 0, 2, date_fmt);
wattron(status_bar, COLOUR_STATUS_BRACKET);
mvwaddch(status_bar, 0, 7, ']');
wattroff(status_bar, COLOUR_STATUS_BRACKET);
g_free(date_fmt);
dirty = TRUE;
}
static void static void
_update_win_statuses(void) _update_win_statuses(void)
{ {