diff options
author | James Booth <boothj5@gmail.com> | 2016-01-23 22:55:04 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-01-23 22:55:04 +0000 |
commit | 2df622f9fd6b54d4d8e86e937b6321dd3c15a371 (patch) | |
tree | 40007632b539f174a05e087a0d77fc05fdb130a0 /src | |
parent | 6ec3f71a5450c81a10d699fb6df67d19119f8ac8 (diff) | |
download | profani-tty-2df622f9fd6b54d4d8e86e937b6321dd3c15a371.tar.gz |
Formatting of /theme properties command output
Diffstat (limited to 'src')
-rw-r--r-- | src/command/command.c | 8 | ||||
-rw-r--r-- | src/ui/console.c | 35 |
2 files changed, 31 insertions, 12 deletions
diff --git a/src/command/command.c b/src/command/command.c index ca84591f..f1e70f12 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -1735,10 +1735,10 @@ static struct cmd_t command_defs[] = CMD_DESC( "Load a theme, includes colours and UI options.") CMD_ARGS( - { "list", "List all available themes." }, - { "load <theme>", "Load the specified theme. 'default' will reset to the default theme." }, - { "colours", "Show the colour values as rendered by the terminal." }, - { "properties", "Show each themed property." }) + { "list", "List all available themes." }, + { "load <theme>", "Load the specified theme. 'default' will reset to the default theme." }, + { "colours", "Show colour values as rendered by the terminal." }, + { "properties", "Show colour settings for current theme." }) CMD_EXAMPLES( "/theme list", "/theme load forest") diff --git a/src/ui/console.c b/src/ui/console.c index a25e55df..d1438340 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -2010,25 +2010,44 @@ void _cons_theme_bar_prop(theme_item_t theme, char *prop) { ProfWin *console = wins_get_console(); - GString *str = g_string_new(" "); + + GString *propstr = g_string_new(" "); + g_string_append_printf(propstr, "%-24s", prop); + win_print(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str); + g_string_free(propstr, TRUE); + + GString *valstr = g_string_new(" "); char *setting = theme_get_string(prop); - g_string_append_printf(str, "%-24s%s ", prop, setting); + g_string_append_printf(valstr, "%s ", setting); theme_free_string(setting); - win_print(console, '-', 0, NULL, NO_EOL, theme, "", str->str); + win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, theme, "", valstr->str); win_print(console, '-', 0, NULL, NO_DATE, THEME_TEXT, "", ""); - g_string_free(str, TRUE); + g_string_free(valstr, TRUE); } void _cons_theme_prop(theme_item_t theme, char *prop) { ProfWin *console = wins_get_console(); - GString *str = g_string_new(" "); + + GString *propstr = g_string_new(" "); + g_string_append_printf(propstr, "%-24s", prop); + win_print(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str); + g_string_free(propstr, TRUE); + + GString *valstr = g_string_new(""); char *setting = theme_get_string(prop); - g_string_append_printf(str, "%-24s%s", prop, setting); + g_string_append_printf(valstr, "%s", setting); theme_free_string(setting); - win_print(console, '-', 0, NULL, 0, theme, "", str->str); - g_string_free(str, TRUE); + win_print(console, '-', 0, NULL, NO_DATE, theme, "", valstr->str); + g_string_free(valstr, TRUE); + +// GString *str = g_string_new(" "); +// char *setting = theme_get_string(prop); +// g_string_append_printf(str, "%-24s%s", prop, setting); +// theme_free_string(setting); +// win_print(console, '-', 0, NULL, 0, theme, "", str->str); +// g_string_free(str, TRUE); } void |