1
0
Fork 0

Allow colorization of history messages

History was always printed with `THEME_DEFAULT` we now use
`THEME_TEXT_HISTORY` which is accesible in theme files via
`main.text.history`.

Fix https://github.com/profanity-im/profanity/issues/1170
This commit is contained in:
Michael Vetter 2019-09-10 11:20:03 +02:00
parent 09b6fc9aaa
commit aa0f497975
4 changed files with 5 additions and 2 deletions

View File

@ -677,6 +677,7 @@ theme_attrs(theme_item_t attrs)
// get forground colour
switch (attrs) {
case THEME_TEXT: _theme_prep_fgnd("main.text", lookup_str, &bold); break;
case THEME_TEXT_HISTORY: _theme_prep_fgnd("main.text.history", lookup_str, &bold); break;
case THEME_TEXT_ME: _theme_prep_fgnd("main.text.me", lookup_str, &bold); break;
case THEME_TEXT_THEM: _theme_prep_fgnd("main.text.them", lookup_str, &bold); break;
case THEME_SPLASH: _theme_prep_fgnd("main.splash", lookup_str, &bold); break;

View File

@ -135,6 +135,7 @@ typedef enum {
THEME_BLACK_BOLD,
THEME_MAGENTA,
THEME_MAGENTA_BOLD,
THEME_TEXT_HISTORY,
} theme_item_t;
void theme_init(const char *const theme_name);

View File

@ -1155,9 +1155,9 @@ win_print_history(ProfWin *window, GDateTime *timestamp, const char *const messa
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, message, arg);
buffer_append(window->layout->buffer, '-', 0, timestamp, NO_COLOUR_DATE, THEME_DEFAULT, "", fmt_msg->str, NULL);
buffer_append(window->layout->buffer, '-', 0, timestamp, 0, THEME_TEXT_HISTORY, "", fmt_msg->str, NULL);
_win_print(window, '-', 0, timestamp, 0, THEME_TEXT_HISTORY, "", fmt_msg->str, NULL);
_win_print(window, '-', 0, timestamp, NO_COLOUR_DATE, THEME_DEFAULT, "", fmt_msg->str, NULL);
inp_nonblocking(TRUE);
g_date_time_unref(timestamp);

View File

@ -22,6 +22,7 @@ statusbar.new=
main.text=
main.text.me=
main.text.them=
main.text.history=
main.splash=
main.time=
input.text=