diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-11-07 20:03:42 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-11-07 20:03:42 +0100 |
commit | 4ac428bace65c0856c1b8914c20f551fe8bf3c9d (patch) | |
tree | eaf5094106bcf1eea873f7d0525cd3641ce71da8 /source | |
parent | 23c04e34fe72c35945a4aaf8b7ee867acce4faa3 (diff) |
[Combi] Add hide prefix option.
Diffstat (limited to 'source')
-rw-r--r-- | source/dialogs/combi.c | 9 | ||||
-rw-r--r-- | source/xrmoptions.c | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/source/dialogs/combi.c b/source/dialogs/combi.c index 077527e2..6e34d422 100644 --- a/source/dialogs/combi.c +++ b/source/dialogs/combi.c @@ -214,10 +214,13 @@ static char * combi_mgrv ( const Mode *sw, unsigned int selected_line, int *stat } for ( unsigned i = 0; i < pd->num_switchers; i++ ) { if ( selected_line >= pd->starts[i] && selected_line < ( pd->starts[i] + pd->lengths[i] ) ) { - char * str = mode_get_display_value ( pd->switchers[i].mode, selected_line - pd->starts[i], state, attr_list, TRUE ); + char * retv; + char * str = retv = mode_get_display_value ( pd->switchers[i].mode, selected_line - pd->starts[i], state, attr_list, TRUE ); const char *dname = mode_get_display_name ( pd->switchers[i].mode ); - char * retv = g_strdup_printf ( "%s %s", dname, str ); - g_free ( str ); + if ( !config.combi_hide_mode_prefix ) { + retv = g_strdup_printf ( "%s %s", dname, str ); + g_free ( str ); + } if ( attr_list != NULL ) { ThemeWidget *wid = rofi_theme_find_widget ( sw->name, NULL, TRUE ); diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 9491db9e..62b89a6e 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -208,6 +208,8 @@ static XrmOption xrmOptions[] = { "Color scheme window", CONFIG_DEFAULT }, { xrm_Number, "max-history-size", { .num = &config.max_history_size }, NULL, "Max history size (WARNING: can cause slowdowns when set to high).", CONFIG_DEFAULT }, + { xrm_Boolean, "combi-hide-mode-prefix", { .snum = &config.combi_hide_mode_prefix }, NULL, + "Hide the prefix mode prefix on the combi view.", CONFIG_DEFAULT }, }; /** Dynamic array of extra options */ |