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

Added receipt.sent theme setting

This commit is contained in:
James Booth 2015-03-15 19:35:25 +00:00
parent 48e06c5a68
commit b21edfaa51
18 changed files with 97 additions and 78 deletions

View File

@ -121,6 +121,7 @@ static struct colours_t {
NCURSES_COLOR_T otruntrusted;
NCURSES_COLOR_T rosterheader;
NCURSES_COLOR_T occupantsheader;
NCURSES_COLOR_T receiptsent;
} colour_prefs;
static NCURSES_COLOR_T _lookup_colour(const char * const colour);
@ -251,47 +252,48 @@ theme_init_colours(void)
// chat
init_pair(25, colour_prefs.me, colour_prefs.bkgnd);
init_pair(26, colour_prefs.them, colour_prefs.bkgnd);
init_pair(27, colour_prefs.receiptsent, colour_prefs.bkgnd);
// room chat
init_pair(27, colour_prefs.roominfo, colour_prefs.bkgnd);
init_pair(28, colour_prefs.roommention, colour_prefs.bkgnd);
init_pair(28, colour_prefs.roominfo, colour_prefs.bkgnd);
init_pair(29, colour_prefs.roommention, colour_prefs.bkgnd);
// statuses
init_pair(29, colour_prefs.online, colour_prefs.bkgnd);
init_pair(30, colour_prefs.offline, colour_prefs.bkgnd);
init_pair(31, colour_prefs.away, colour_prefs.bkgnd);
init_pair(32, colour_prefs.chat, colour_prefs.bkgnd);
init_pair(33, colour_prefs.dnd, colour_prefs.bkgnd);
init_pair(34, colour_prefs.xa, colour_prefs.bkgnd);
init_pair(30, colour_prefs.online, colour_prefs.bkgnd);
init_pair(31, colour_prefs.offline, colour_prefs.bkgnd);
init_pair(32, colour_prefs.away, colour_prefs.bkgnd);
init_pair(33, colour_prefs.chat, colour_prefs.bkgnd);
init_pair(34, colour_prefs.dnd, colour_prefs.bkgnd);
init_pair(35, colour_prefs.xa, colour_prefs.bkgnd);
// states
init_pair(35, colour_prefs.typing, colour_prefs.bkgnd);
init_pair(36, colour_prefs.gone, colour_prefs.bkgnd);
init_pair(36, colour_prefs.typing, colour_prefs.bkgnd);
init_pair(37, colour_prefs.gone, colour_prefs.bkgnd);
// subscription status
init_pair(37, colour_prefs.subscribed, colour_prefs.bkgnd);
init_pair(38, colour_prefs.unsubscribed, colour_prefs.bkgnd);
init_pair(38, colour_prefs.subscribed, colour_prefs.bkgnd);
init_pair(39, colour_prefs.unsubscribed, colour_prefs.bkgnd);
// otr messages
init_pair(39, colour_prefs.otrstartedtrusted, colour_prefs.bkgnd);
init_pair(40, colour_prefs.otrstarteduntrusted, colour_prefs.bkgnd);
init_pair(41, colour_prefs.otrended, colour_prefs.bkgnd);
init_pair(42, colour_prefs.otrtrusted, colour_prefs.bkgnd);
init_pair(43, colour_prefs.otruntrusted, colour_prefs.bkgnd);
init_pair(40, colour_prefs.otrstartedtrusted, colour_prefs.bkgnd);
init_pair(41, colour_prefs.otrstarteduntrusted, colour_prefs.bkgnd);
init_pair(42, colour_prefs.otrended, colour_prefs.bkgnd);
init_pair(43, colour_prefs.otrtrusted, colour_prefs.bkgnd);
init_pair(44, colour_prefs.otruntrusted, colour_prefs.bkgnd);
// subwin headers
init_pair(44, colour_prefs.rosterheader, colour_prefs.bkgnd);
init_pair(45, colour_prefs.occupantsheader, colour_prefs.bkgnd);
init_pair(45, colour_prefs.rosterheader, colour_prefs.bkgnd);
init_pair(46, colour_prefs.occupantsheader, colour_prefs.bkgnd);
// raw
init_pair(46, COLOR_WHITE, colour_prefs.bkgnd);
init_pair(47, COLOR_GREEN, colour_prefs.bkgnd);
init_pair(48, COLOR_RED, colour_prefs.bkgnd);
init_pair(49, COLOR_YELLOW, colour_prefs.bkgnd);
init_pair(50, COLOR_BLUE, colour_prefs.bkgnd);
init_pair(51, COLOR_CYAN, colour_prefs.bkgnd);
init_pair(52, COLOR_BLACK, colour_prefs.bkgnd);
init_pair(53, COLOR_MAGENTA, colour_prefs.bkgnd);
init_pair(47, COLOR_WHITE, colour_prefs.bkgnd);
init_pair(48, COLOR_GREEN, colour_prefs.bkgnd);
init_pair(49, COLOR_RED, colour_prefs.bkgnd);
init_pair(50, COLOR_YELLOW, colour_prefs.bkgnd);
init_pair(51, COLOR_BLUE, colour_prefs.bkgnd);
init_pair(52, COLOR_CYAN, colour_prefs.bkgnd);
init_pair(53, COLOR_BLACK, colour_prefs.bkgnd);
init_pair(54, COLOR_MAGENTA, colour_prefs.bkgnd);
}
static NCURSES_COLOR_T
@ -397,6 +399,7 @@ _load_colours(void)
_set_colour("them", &colour_prefs.them, COLOR_GREEN, THEME_THEM);
_set_colour("roster.header", &colour_prefs.rosterheader, COLOR_YELLOW, THEME_ROSTER_HEADER);
_set_colour("occupants.header", &colour_prefs.occupantsheader, COLOR_YELLOW, THEME_OCCUPANTS_HEADER);
_set_colour("receipt.sent", &colour_prefs.receiptsent, COLOR_RED, THEME_RECEIPT_SENT);
}
static void
@ -564,41 +567,42 @@ theme_attrs(theme_item_t attrs)
case THEME_STATUS_NEW: result = COLOR_PAIR(24); break;
case THEME_ME: result = COLOR_PAIR(25); break;
case THEME_THEM: result = COLOR_PAIR(26); break;
case THEME_ROOMINFO: result = COLOR_PAIR(27); break;
case THEME_ROOMMENTION: result = COLOR_PAIR(28); break;
case THEME_ONLINE: result = COLOR_PAIR(29); break;
case THEME_OFFLINE: result = COLOR_PAIR(30); break;
case THEME_AWAY: result = COLOR_PAIR(31); break;
case THEME_CHAT: result = COLOR_PAIR(32); break;
case THEME_DND: result = COLOR_PAIR(33); break;
case THEME_XA: result = COLOR_PAIR(34); break;
case THEME_TYPING: result = COLOR_PAIR(35); break;
case THEME_GONE: result = COLOR_PAIR(36); break;
case THEME_SUBSCRIBED: result = COLOR_PAIR(37); break;
case THEME_UNSUBSCRIBED: result = COLOR_PAIR(38); break;
case THEME_OTR_STARTED_TRUSTED: result = COLOR_PAIR(39); break;
case THEME_OTR_STARTED_UNTRUSTED: result = COLOR_PAIR(40); break;
case THEME_OTR_ENDED: result = COLOR_PAIR(41); break;
case THEME_OTR_TRUSTED: result = COLOR_PAIR(42); break;
case THEME_OTR_UNTRUSTED: result = COLOR_PAIR(43); break;
case THEME_ROSTER_HEADER: result = COLOR_PAIR(44); break;
case THEME_OCCUPANTS_HEADER: result = COLOR_PAIR(45); break;
case THEME_WHITE: result = COLOR_PAIR(46); break;
case THEME_WHITE_BOLD: result = COLOR_PAIR(46); break;
case THEME_GREEN: result = COLOR_PAIR(47); break;
case THEME_GREEN_BOLD: result = COLOR_PAIR(47); break;
case THEME_RED: result = COLOR_PAIR(48); break;
case THEME_RED_BOLD: result = COLOR_PAIR(48); break;
case THEME_YELLOW: result = COLOR_PAIR(49); break;
case THEME_YELLOW_BOLD: result = COLOR_PAIR(49); break;
case THEME_BLUE: result = COLOR_PAIR(50); break;
case THEME_BLUE_BOLD: result = COLOR_PAIR(50); break;
case THEME_CYAN: result = COLOR_PAIR(51); break;
case THEME_CYAN_BOLD: result = COLOR_PAIR(51); break;
case THEME_BLACK: result = COLOR_PAIR(52); break;
case THEME_BLACK_BOLD: result = COLOR_PAIR(52); break;
case THEME_MAGENTA: result = COLOR_PAIR(53); break;
case THEME_MAGENTA_BOLD: result = COLOR_PAIR(53); break;
case THEME_RECEIPT_SENT: result = COLOR_PAIR(27); break;
case THEME_ROOMINFO: result = COLOR_PAIR(28); break;
case THEME_ROOMMENTION: result = COLOR_PAIR(29); break;
case THEME_ONLINE: result = COLOR_PAIR(30); break;
case THEME_OFFLINE: result = COLOR_PAIR(31); break;
case THEME_AWAY: result = COLOR_PAIR(32); break;
case THEME_CHAT: result = COLOR_PAIR(33); break;
case THEME_DND: result = COLOR_PAIR(34); break;
case THEME_XA: result = COLOR_PAIR(35); break;
case THEME_TYPING: result = COLOR_PAIR(36); break;
case THEME_GONE: result = COLOR_PAIR(37); break;
case THEME_SUBSCRIBED: result = COLOR_PAIR(38); break;
case THEME_UNSUBSCRIBED: result = COLOR_PAIR(39); break;
case THEME_OTR_STARTED_TRUSTED: result = COLOR_PAIR(40); break;
case THEME_OTR_STARTED_UNTRUSTED: result = COLOR_PAIR(41); break;
case THEME_OTR_ENDED: result = COLOR_PAIR(42); break;
case THEME_OTR_TRUSTED: result = COLOR_PAIR(43); break;
case THEME_OTR_UNTRUSTED: result = COLOR_PAIR(44); break;
case THEME_ROSTER_HEADER: result = COLOR_PAIR(45); break;
case THEME_OCCUPANTS_HEADER: result = COLOR_PAIR(46); break;
case THEME_WHITE: result = COLOR_PAIR(47); break;
case THEME_WHITE_BOLD: result = COLOR_PAIR(47); break;
case THEME_GREEN: result = COLOR_PAIR(48); break;
case THEME_GREEN_BOLD: result = COLOR_PAIR(48); break;
case THEME_RED: result = COLOR_PAIR(49); break;
case THEME_RED_BOLD: result = COLOR_PAIR(49); break;
case THEME_YELLOW: result = COLOR_PAIR(50); break;
case THEME_YELLOW_BOLD: result = COLOR_PAIR(50); break;
case THEME_BLUE: result = COLOR_PAIR(51); break;
case THEME_BLUE_BOLD: result = COLOR_PAIR(51); break;
case THEME_CYAN: result = COLOR_PAIR(52); break;
case THEME_CYAN_BOLD: result = COLOR_PAIR(52); break;
case THEME_BLACK: result = COLOR_PAIR(53); break;
case THEME_BLACK_BOLD: result = COLOR_PAIR(53); break;
case THEME_MAGENTA: result = COLOR_PAIR(54); break;
case THEME_MAGENTA_BOLD: result = COLOR_PAIR(54); break;
default: break;
}

View File

@ -90,6 +90,7 @@ typedef enum {
THEME_OTR_UNTRUSTED,
THEME_OCCUPANTS_HEADER,
THEME_ROSTER_HEADER,
THEME_RECEIPT_SENT,
THEME_NONE,
THEME_WHITE,
THEME_WHITE_BOLD,

View File

@ -980,7 +980,7 @@ _win_print(ProfWin *window, const char show_char, GDateTime *time,
}
if (receipt && !receipt->received) {
colour = theme_attrs(THEME_BLACK_BOLD);
colour = theme_attrs(THEME_RECEIPT_SENT);
}
wattron(window->layout->win, colour);
@ -996,7 +996,7 @@ _win_print(ProfWin *window, const char show_char, GDateTime *time,
if (!me_message) {
if (receipt && !receipt->received) {
wattron(window->layout->win, theme_attrs(THEME_BLACK_BOLD));
wattron(window->layout->win, theme_attrs(THEME_RECEIPT_SENT));
} else {
wattron(window->layout->win, theme_attrs(theme_item));
}
@ -1016,7 +1016,7 @@ _win_print(ProfWin *window, const char show_char, GDateTime *time,
wattroff(window->layout->win, colour);
} else {
if (receipt && !receipt->received) {
wattroff(window->layout->win, theme_attrs(THEME_BLACK_BOLD));
wattroff(window->layout->win, theme_attrs(THEME_RECEIPT_SENT));
} else {
wattroff(window->layout->win, theme_attrs(theme_item));
}

View File

@ -47,6 +47,7 @@ me=
them=
roster.header=
occupants.header=
receipt.sent=
[ui]
beep=
@ -69,4 +70,4 @@ roster.resource=
roster.by=
roster.size=
occupants=
occupants.size=
occupants.size=

View File

@ -47,3 +47,4 @@ me=cyan
them=white
roster.header=bold_white
occupants.header=bold_white
receipt.sent=white

View File

@ -34,7 +34,6 @@ otr.started.untrusted=red
otr.ended=yellow
otr.trusted=green
otr.untrusted=red
titlebar.online=magenta
titlebar.offline=black
titlebar.away=magenta
@ -47,4 +46,5 @@ subscribed=magenta
unsubscribed=black_bold
roommention=cyan
roster.header=yellow
occupants.header=yellow
occupants.header=yellow
receipt.sent=red

View File

@ -47,6 +47,7 @@ me=blue
them=bold_green
roster.header=bold_yellow
occupants.header=bold_yellow
receipt.sent=bold_black
[ui]
beep=false

View File

@ -46,4 +46,5 @@ roommention=bold_cyan
me=blue
them=bold_blue
roster.header=bold_green
occupants.header=bold_green
occupants.header=bold_green
receipt.sent=bold_black

View File

@ -46,4 +46,5 @@ roommention=bold_green
me=green
them=bold_green
roster.header=bold_green
occupants.header=bold_green
occupants.header=bold_green
receipt.sent=bold_black

View File

@ -46,4 +46,5 @@ roommention=bold_green
me=white
them=white
roster.header=bold_cyan
occupants.header=bold_cyan
occupants.header=bold_cyan
receipt.sent=red

View File

@ -46,4 +46,5 @@ roommention=green
me=magenta
them=green
roster.header=magenta
occupants.header=magenta
occupants.header=magenta
receipt.sent=red

View File

@ -46,4 +46,5 @@ roommention=white
me=white
them=white
roster.header=white
occupants.header=white
occupants.header=white
receipt.sent=white

View File

@ -46,4 +46,5 @@ roommention=blue
me=black
them=black
roster.header=black
occupants.header=black
occupants.header=black
receipt.sent=red

View File

@ -46,4 +46,5 @@ roommention=yellow
me=yellow
them=green
roster.header=yellow
occupants.header=yellow
occupants.header=yellow
receipt.sent=red

View File

@ -47,3 +47,4 @@ me=bold_yellow
them=bold_green
roster.header=bold_yellow
occupants.header=bold_yellow
receipt.sent=bold_red

View File

@ -46,4 +46,5 @@ roommention=green
me=bold_black
them=magenta
roster.header=magenta
occupants.header=magenta
occupants.header=magenta
receipt.sent=red

View File

@ -46,4 +46,5 @@ roommention=red
me=green
them=yellow
roster.header=white
occupants.header=white
occupants.header=white
receipt.sent=red

View File

@ -46,4 +46,5 @@ roommention=yellow
me=black
them=black
roster.header=black
occupants.header=black
occupants.header=black
receipt.sent=red