From 6693b044e326361f8b82bb64fa7a4c8b256a839b Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Fri, 8 Oct 2021 00:44:47 +0200 Subject: Used macro to define status pattern and values together. Use a more flexible way to specify how the setting flags are shown on statusbar. --- src/main.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index b499918..cbd6b0f 100644 --- a/src/main.c +++ b/src/main.c @@ -631,21 +631,18 @@ void vb_statusbar_update(Client *c) statusbar_update_downloads(c, status); - /** - * These architectures have different kinds of issues with scroll - * percentage, this is a somewhat clean fix that doesn't affect others. - */ + /* These architectures have different kinds of issues with scroll + * percentage, this is a somewhat clean fix that doesn't affect others. */ #if defined(_ARCH_PPC64) || defined(_ARCH_PPC) | defined(_ARCH_ARM) - /* force the scroll percent to be 16-bit */ - c->state.scroll_percent = * (guint16*) ( &c->state.scroll_percent ); + /* force the scroll percent to be 16-bit */ + c->state.scroll_percent = *(guint16*)(&c->state.scroll_percent); #endif - if ( c->config.statusbar_show_settings ) { - /* show 3 user defined variables on statusbar. can add more by using same template */ - g_string_append_printf(status, " %s: %s |", STATUS_NAME1, STATUS_TYPE1 ); - g_string_append_printf(status, " %s: %s |", STATUS_NAME2, STATUS_TYPE2 ); - g_string_append_printf(status, " %s: %s |", STATUS_NAME3, STATUS_TYPE3 ); +#ifdef STATUS_VARAIBLE_SHOW + if (c->config.statusbar_show_settings) { + g_string_append_printf(status, STATUS_VARAIBLE_SHOW); } +#endif /* show the scroll status */ if (c->state.scroll_max == 0) { -- cgit v1.2.3