Preference to show/hide tab number

This commit is contained in:
James Booth
2018-03-09 23:44:28 +00:00
parent e96af8537c
commit 6f5c0eb525
7 changed files with 77 additions and 35 deletions

View File

@@ -5776,17 +5776,39 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
ui_resize();
return TRUE;
}
if (g_strcmp0(args[1], "number") == 0) {
prefs_set_boolean(PREF_STATUSBAR_SHOW_NUMBER, TRUE);
cons_show("Enabled showing tab numbers.");
ui_resize();
return TRUE;
}
cons_bad_cmd_usage(command);
return TRUE;
}
if (g_strcmp0(args[0], "hide") == 0) {
if (g_strcmp0(args[1], "name") == 0) {
if (prefs_get_boolean(PREF_STATUSBAR_SHOW_NUMBER) == FALSE) {
cons_show("Cannot disable both names and numbers in statusbar.");
cons_show("Use '/statusbar maxtabs 0' to hide tabs.");
return TRUE;
}
prefs_set_boolean(PREF_STATUSBAR_SHOW_NAME, FALSE);
cons_show("Disabled showing tab names.");
ui_resize();
return TRUE;
}
if (g_strcmp0(args[1], "number") == 0) {
if (prefs_get_boolean(PREF_STATUSBAR_SHOW_NAME) == FALSE) {
cons_show("Cannot disable both names and numbers in statusbar.");
cons_show("Use '/statusbar maxtabs 0' to hide tabs.");
return TRUE;
}
prefs_set_boolean(PREF_STATUSBAR_SHOW_NUMBER, FALSE);
cons_show("Disabled showing tab numbers.");
ui_resize();
return TRUE;
}
cons_bad_cmd_usage(command);
return TRUE;
}