Display attention hint in titlebar for mucs too
* Display the `[ATTENTION]` hint in the titlebar for both chatwins and mucwins. * Use THEME_TITLE_TEXT instead of THEME_TITLE_ENCRYPT * Have separate function `_show_attention` and don't do it in unrelated `_show_privacy`.
This commit is contained in:
@@ -67,6 +67,7 @@ static void _show_contact_presence(ProfChatWin* chatwin, int pos, int maxpos);
|
|||||||
static void _show_privacy(ProfChatWin* chatwin);
|
static void _show_privacy(ProfChatWin* chatwin);
|
||||||
static void _show_muc_privacy(ProfMucWin* mucwin);
|
static void _show_muc_privacy(ProfMucWin* mucwin);
|
||||||
static void _show_scrolled(ProfWin* current);
|
static void _show_scrolled(ProfWin* current);
|
||||||
|
static void _show_attention(ProfWin* current, gboolean attention);
|
||||||
|
|
||||||
void
|
void
|
||||||
create_title_bar(void)
|
create_title_bar(void)
|
||||||
@@ -210,6 +211,7 @@ _title_bar_draw(void)
|
|||||||
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
||||||
_show_contact_presence(chatwin, pos, maxrightpos);
|
_show_contact_presence(chatwin, pos, maxrightpos);
|
||||||
_show_privacy(chatwin);
|
_show_privacy(chatwin);
|
||||||
|
_show_attention(current, chatwin->has_attention);
|
||||||
_show_scrolled(current);
|
_show_scrolled(current);
|
||||||
|
|
||||||
if (typing) {
|
if (typing) {
|
||||||
@@ -219,6 +221,7 @@ _title_bar_draw(void)
|
|||||||
ProfMucWin* mucwin = (ProfMucWin*)current;
|
ProfMucWin* mucwin = (ProfMucWin*)current;
|
||||||
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
|
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
|
||||||
_show_muc_privacy(mucwin);
|
_show_muc_privacy(mucwin);
|
||||||
|
_show_attention(current, mucwin->has_attention);
|
||||||
_show_scrolled(current);
|
_show_scrolled(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,6 +231,26 @@ _title_bar_draw(void)
|
|||||||
inp_put_back();
|
inp_put_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_show_attention(ProfWin* current, gboolean attention)
|
||||||
|
{
|
||||||
|
int bracket_attrs = theme_attrs(THEME_TITLE_BRACKET);
|
||||||
|
int text_attrs = theme_attrs(THEME_TITLE_TEXT);
|
||||||
|
|
||||||
|
if (attention) {
|
||||||
|
wprintw(win, " ");
|
||||||
|
wattron(win, bracket_attrs);
|
||||||
|
wprintw(win, "[");
|
||||||
|
wattroff(win, bracket_attrs);
|
||||||
|
wattron(win, text_attrs);
|
||||||
|
wprintw(win, "ATTENTION");
|
||||||
|
wattroff(win, text_attrs);
|
||||||
|
wattron(win, bracket_attrs);
|
||||||
|
wprintw(win, "]");
|
||||||
|
wattroff(win, bracket_attrs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_show_scrolled(ProfWin* current)
|
_show_scrolled(ProfWin* current)
|
||||||
{
|
{
|
||||||
@@ -487,18 +510,6 @@ _show_privacy(ProfChatWin* chatwin)
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (chatwin->has_attention) {
|
|
||||||
wprintw(win, " ");
|
|
||||||
wattron(win, bracket_attrs);
|
|
||||||
wprintw(win, "[");
|
|
||||||
wattroff(win, bracket_attrs);
|
|
||||||
wattron(win, encrypted_attrs);
|
|
||||||
wprintw(win, "ATTENTION");
|
|
||||||
wattroff(win, encrypted_attrs);
|
|
||||||
wattron(win, bracket_attrs);
|
|
||||||
wprintw(win, "]");
|
|
||||||
wattroff(win, bracket_attrs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (chatwin->pgp_send || chatwin->pgp_recv) {
|
if (chatwin->pgp_send || chatwin->pgp_recv) {
|
||||||
GString* pgpmsg = g_string_new("PGP ");
|
GString* pgpmsg = g_string_new("PGP ");
|
||||||
|
|||||||
Reference in New Issue
Block a user