diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-05-21 16:04:26 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-05-21 16:15:14 +0200 |
commit | cb78ee46656972a5481ad0241fb50dc0e0d02413 (patch) | |
tree | 8d4b45ec8345324320bfaf13ee2208b9035041c6 /src/command | |
parent | e41ae21bea63484645c0ef5f98e870bd80bc1c8c (diff) | |
download | profani-tty-cb78ee46656972a5481ad0241fb50dc0e0d02413.tar.gz |
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
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/cmd_ac.c | 1 | ||||
-rw-r--r-- | src/command/cmd_defs.c | 6 | ||||
-rw-r--r-- | src/command/cmd_funcs.c | 12 |
3 files changed, 17 insertions, 2 deletions
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 <value>", "/statusbar tablen <value>", "/statusbar self user|barejid|fulljid|off", @@ -1359,6 +1359,7 @@ static struct cmd_t command_defs[] = { "tablen <value>", "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; } |