From cb78ee46656972a5481ad0241fb50dc0e0d02413 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 21 May 2020 16:04:26 +0200 Subject: Make option to allow hiding windows with no messages in statusbar `statusbar.show.read` can be set to false in the config. `/statusbar show|hide read`. Implement https://github.com/profanity-im/profanity/issues/1285 --- src/command/cmd_ac.c | 1 + src/command/cmd_defs.c | 6 ++++-- src/command/cmd_funcs.c | 12 ++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/command') diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index e0d5f577..3c9daaee 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -955,6 +955,7 @@ cmd_ac_init(void) statusbar_show_ac = autocomplete_new(); autocomplete_add(statusbar_show_ac, "name"); autocomplete_add(statusbar_show_ac, "number"); + autocomplete_add(statusbar_show_ac, "read"); status_ac = autocomplete_new(); autocomplete_add(status_ac, "set"); diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index e6d3f969..8c67d307 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -1343,8 +1343,8 @@ static struct cmd_t command_defs[] = CMD_TAGS( CMD_TAG_UI) CMD_SYN( - "/statusbar show name|number", - "/statusbar hide name|number", + "/statusbar show name|number|read", + "/statusbar hide name|number|read", "/statusbar maxtabs ", "/statusbar tablen ", "/statusbar self user|barejid|fulljid|off", @@ -1359,6 +1359,7 @@ static struct cmd_t command_defs[] = { "tablen ", "Set the maximum number of characters to show as the tab name, 0 sets to unlimited." }, { "show|hide name", "Show or hide names in tabs." }, { "show|hide number", "Show or hide numbers in tabs." }, + { "show|hide read", "Show or hide inactive tabs." }, { "self user|barejid|fulljid", "Show account user name, barejid, fulljid as status bar title." }, { "self off", "Disable showing self as status bar title." }, { "chat user|jid", "Show users name, or the fulljid if no nick is present for chat tabs." }, @@ -1370,6 +1371,7 @@ static struct cmd_t command_defs[] = "/statusbar tablen 5", "/statusbar self user", "/statusbar chat jid", + "/statusbar hide read", "/statusbar hide name") }, diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 580494e2..758d356f 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6070,6 +6070,12 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args) ui_resize(); return TRUE; } + if (g_strcmp0(args[1], "read") == 0) { + prefs_set_boolean(PREF_STATUSBAR_SHOW_READ, TRUE); + cons_show("Enabled showing inactive tabs."); + ui_resize(); + return TRUE; + } cons_bad_cmd_usage(command); return TRUE; } @@ -6097,6 +6103,12 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args) ui_resize(); return TRUE; } + if (g_strcmp0(args[1], "read") == 0) { + prefs_set_boolean(PREF_STATUSBAR_SHOW_READ, FALSE); + cons_show("Disabled showing inactive tabs."); + ui_resize(); + return TRUE; + } cons_bad_cmd_usage(command); return TRUE; } -- cgit 1.4.1-2-gfad0