mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Added main.help.header theme option
This commit is contained in:
parent
eac6b52e05
commit
c0f099cb84
@ -1483,9 +1483,9 @@ _cmd_help_cmd_list(const char *const tag)
|
|||||||
cons_show("");
|
cons_show("");
|
||||||
ProfWin *console = wins_get_console();
|
ProfWin *console = wins_get_console();
|
||||||
if (tag) {
|
if (tag) {
|
||||||
win_println(console, THEME_WHITE_BOLD, '-', "%s commands", tag);
|
win_println(console, THEME_HELP_HEADER, '-', "%s commands", tag);
|
||||||
} else {
|
} else {
|
||||||
win_println(console, THEME_WHITE_BOLD, '-', "All commands");
|
win_println(console, THEME_HELP_HEADER, '-', "All commands");
|
||||||
}
|
}
|
||||||
|
|
||||||
GList *ordered_commands = NULL;
|
GList *ordered_commands = NULL;
|
||||||
|
@ -81,6 +81,7 @@ theme_init(const char *const theme_name)
|
|||||||
g_hash_table_insert(defaults, strdup("main.text.me"), strdup("white"));
|
g_hash_table_insert(defaults, strdup("main.text.me"), strdup("white"));
|
||||||
g_hash_table_insert(defaults, strdup("main.text.them"), strdup("white"));
|
g_hash_table_insert(defaults, strdup("main.text.them"), strdup("white"));
|
||||||
g_hash_table_insert(defaults, strdup("main.splash"), strdup("cyan"));
|
g_hash_table_insert(defaults, strdup("main.splash"), strdup("cyan"));
|
||||||
|
g_hash_table_insert(defaults, strdup("main.help.header"), strdup("white"));
|
||||||
g_hash_table_insert(defaults, strdup("error"), strdup("red"));
|
g_hash_table_insert(defaults, strdup("error"), strdup("red"));
|
||||||
g_hash_table_insert(defaults, strdup("incoming"), strdup("yellow"));
|
g_hash_table_insert(defaults, strdup("incoming"), strdup("yellow"));
|
||||||
g_hash_table_insert(defaults, strdup("mention"), strdup("yellow"));
|
g_hash_table_insert(defaults, strdup("mention"), strdup("yellow"));
|
||||||
@ -731,6 +732,7 @@ theme_attrs(theme_item_t attrs)
|
|||||||
case THEME_TEXT_ME: _theme_prep_fgnd("main.text.me", lookup_str, &bold); break;
|
case THEME_TEXT_ME: _theme_prep_fgnd("main.text.me", lookup_str, &bold); break;
|
||||||
case THEME_TEXT_THEM: _theme_prep_fgnd("main.text.them", lookup_str, &bold); break;
|
case THEME_TEXT_THEM: _theme_prep_fgnd("main.text.them", lookup_str, &bold); break;
|
||||||
case THEME_SPLASH: _theme_prep_fgnd("main.splash", lookup_str, &bold); break;
|
case THEME_SPLASH: _theme_prep_fgnd("main.splash", lookup_str, &bold); break;
|
||||||
|
case THEME_HELP_HEADER: _theme_prep_fgnd("main.help.header", lookup_str, &bold); break;
|
||||||
case THEME_ERROR: _theme_prep_fgnd("error", lookup_str, &bold); break;
|
case THEME_ERROR: _theme_prep_fgnd("error", lookup_str, &bold); break;
|
||||||
case THEME_INCOMING: _theme_prep_fgnd("incoming", lookup_str, &bold); break;
|
case THEME_INCOMING: _theme_prep_fgnd("incoming", lookup_str, &bold); break;
|
||||||
case THEME_MENTION: _theme_prep_fgnd("mention", lookup_str, &bold); break;
|
case THEME_MENTION: _theme_prep_fgnd("mention", lookup_str, &bold); break;
|
||||||
|
@ -46,6 +46,7 @@ typedef enum {
|
|||||||
THEME_TEXT_ME,
|
THEME_TEXT_ME,
|
||||||
THEME_TEXT_THEM,
|
THEME_TEXT_THEM,
|
||||||
THEME_SPLASH,
|
THEME_SPLASH,
|
||||||
|
THEME_HELP_HEADER,
|
||||||
THEME_ERROR,
|
THEME_ERROR,
|
||||||
THEME_INCOMING,
|
THEME_INCOMING,
|
||||||
THEME_MENTION,
|
THEME_MENTION,
|
||||||
|
@ -110,20 +110,20 @@ cons_show_help(const char *const cmd, CommandHelp *help)
|
|||||||
ProfWin *console = wins_get_console();
|
ProfWin *console = wins_get_console();
|
||||||
|
|
||||||
cons_show("");
|
cons_show("");
|
||||||
win_println(console, THEME_WHITE_BOLD, '-', "%s", &cmd[1]);
|
win_println(console, THEME_HELP_HEADER, '-', "%s", &cmd[1]);
|
||||||
win_print(console, THEME_WHITE_BOLD, '-', "");
|
win_print(console, THEME_HELP_HEADER, '-', "");
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < strlen(cmd) - 1 ; i++) {
|
for (i = 0; i < strlen(cmd) - 1 ; i++) {
|
||||||
win_append(console, THEME_WHITE_BOLD, "-");
|
win_append(console, THEME_HELP_HEADER, "-");
|
||||||
}
|
}
|
||||||
win_appendln(console, THEME_WHITE_BOLD, "");
|
win_appendln(console, THEME_HELP_HEADER, "");
|
||||||
cons_show("");
|
cons_show("");
|
||||||
|
|
||||||
win_println(console, THEME_WHITE_BOLD, '-', "Synopsis");
|
win_println(console, THEME_HELP_HEADER, '-', "Synopsis");
|
||||||
ui_show_lines(console, help->synopsis);
|
ui_show_lines(console, help->synopsis);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
|
|
||||||
win_println(console, THEME_WHITE_BOLD, '-', "Description");
|
win_println(console, THEME_HELP_HEADER, '-', "Description");
|
||||||
win_println(console, THEME_DEFAULT, '-', "%s", help->desc);
|
win_println(console, THEME_DEFAULT, '-', "%s", help->desc);
|
||||||
|
|
||||||
int maxlen = 0;
|
int maxlen = 0;
|
||||||
@ -134,7 +134,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
|
|||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
cons_show("");
|
cons_show("");
|
||||||
win_println(console, THEME_WHITE_BOLD, '-', "Arguments");
|
win_println(console, THEME_HELP_HEADER, '-', "Arguments");
|
||||||
for (i = 0; help->args[i][0] != NULL; i++) {
|
for (i = 0; help->args[i][0] != NULL; i++) {
|
||||||
win_println_indent(console, maxlen + 3, "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]);
|
win_println_indent(console, maxlen + 3, "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]);
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
|
|||||||
|
|
||||||
if (g_strv_length((gchar**)help->examples) > 0) {
|
if (g_strv_length((gchar**)help->examples) > 0) {
|
||||||
cons_show("");
|
cons_show("");
|
||||||
win_println(console, THEME_WHITE_BOLD, '-', "Arguments");
|
win_println(console, THEME_HELP_HEADER, '-', "Arguments");
|
||||||
ui_show_lines(console, help->examples);
|
ui_show_lines(console, help->examples);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2063,7 +2063,7 @@ cons_navigation_help(void)
|
|||||||
{
|
{
|
||||||
ProfWin *console = wins_get_console();
|
ProfWin *console = wins_get_console();
|
||||||
cons_show("");
|
cons_show("");
|
||||||
win_println(console, THEME_WHITE_BOLD, '-', "Navigation");
|
win_println(console, THEME_HELP_HEADER, '-', "Navigation");
|
||||||
cons_show("Alt-1..Alt-0, F1..F10 : Choose window.");
|
cons_show("Alt-1..Alt-0, F1..F10 : Choose window.");
|
||||||
cons_show("Alt-LEFT, Alt-RIGHT : Previous/next chat window.");
|
cons_show("Alt-LEFT, Alt-RIGHT : Previous/next chat window.");
|
||||||
cons_show("PAGEUP, PAGEDOWN : Page the main window.");
|
cons_show("PAGEUP, PAGEDOWN : Page the main window.");
|
||||||
|
Loading…
Reference in New Issue
Block a user