mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Tidied title bar draw
This commit is contained in:
parent
e756daf2be
commit
aae88753a3
@ -169,35 +169,32 @@ title_bar_set_typing(gboolean is_typing)
|
||||
static void
|
||||
_title_bar_draw(void)
|
||||
{
|
||||
werase(win);
|
||||
ProfWin *current = wins_get_current();
|
||||
|
||||
// show title
|
||||
werase(win);
|
||||
wmove(win, 0, 0);
|
||||
int i;
|
||||
for (i = 0; i < 45; i++)
|
||||
for (i = 0; i < 45; i++) {
|
||||
waddch(win, ' ');
|
||||
}
|
||||
|
||||
mvwprintw(win, 0, 0, " %s", current_title);
|
||||
|
||||
if (current && current->type == WIN_CHAT) {
|
||||
if (prefs_get_boolean(PREF_PRESENCE)) {
|
||||
_show_contact_presence();
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBOTR
|
||||
_show_privacy();
|
||||
#endif
|
||||
|
||||
// show indicator for unsaved forms
|
||||
ProfWin *current = wins_get_current();
|
||||
if ((current != NULL ) && (current->type == WIN_MUC_CONFIG)) {
|
||||
if ((current->form != NULL) && (current->form->modified)) {
|
||||
wprintw(win, " *");
|
||||
}
|
||||
}
|
||||
|
||||
// show contact typing
|
||||
if (typing) {
|
||||
wprintw(win, " (typing...)");
|
||||
}
|
||||
} else if (current && current->type == WIN_MUC_CONFIG) {
|
||||
if (current->form && current->form->modified) {
|
||||
wprintw(win, " *");
|
||||
}
|
||||
}
|
||||
|
||||
_show_self_presence();
|
||||
|
||||
@ -268,7 +265,6 @@ _show_privacy(void)
|
||||
int bracket_attrs = theme_attrs(THEME_TITLE_BRACKET);
|
||||
|
||||
ProfWin *current = wins_get_current();
|
||||
if (current && current->type == WIN_CHAT) {
|
||||
if (!current->is_otr) {
|
||||
if (prefs_get_boolean(PREF_OTR_WARN)) {
|
||||
int unencrypted_attrs = theme_attrs(THEME_TITLE_UNENCRYPTED);
|
||||
@ -321,7 +317,6 @@ _show_privacy(void)
|
||||
wattroff(win, bracket_attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -330,8 +325,6 @@ _show_contact_presence(void)
|
||||
{
|
||||
int bracket_attrs = theme_attrs(THEME_TITLE_BRACKET);
|
||||
|
||||
ProfWin *current = wins_get_current();
|
||||
if (current && current->type == WIN_CHAT) {
|
||||
theme_item_t presence_colour = THEME_TITLE_OFFLINE;
|
||||
const char *presence = "offline";
|
||||
|
||||
@ -366,5 +359,4 @@ _show_contact_presence(void)
|
||||
wattron(win, bracket_attrs);
|
||||
wprintw(win, "]");
|
||||
wattroff(win, bracket_attrs);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user