Option to disable/enable the highlighting of match.

This commit is contained in:
Dave Davenport 2016-10-24 21:46:39 +02:00
parent b19ab62e17
commit 440756af94
4 changed files with 7 additions and 1 deletions

View File

@ -131,4 +131,5 @@ Settings config = {
.fake_background = "screenshot",
.window_format = "{w} {c} {t}",
.click_to_exit = TRUE,
.show_match = TRUE,
};

View File

@ -1,6 +1,8 @@
#ifndef ROFI_SETTINGS_H
#define ROFI_SETTINGS_H
#include <glib.h>
/**
* Enumeration indicating the matching method to use.
*
@ -148,6 +150,7 @@ typedef struct
char *window_format;
/** Click outside the window to exit */
int click_to_exit;
gboolean show_match;
} Settings;
/** Global Settings structure. */
extern Settings config;

View File

@ -698,7 +698,7 @@ static void update_callback ( textbox *t, unsigned int index, void *udata, TextB
// Move into list view.
textbox_text ( t, text );
if ( state->tokens ) {
if ( state->tokens && config.show_match ) {
PangoAttrList *list = textbox_get_pango_attributes ( t );
if ( list != NULL ) {
pango_attr_list_ref ( list );

View File

@ -194,6 +194,8 @@ static XrmOption xrmOptions[] = {
"Window Format. w (desktop name), t (title), n (name), r (role), c (class)", CONFIG_DEFAULT },
{ xrm_Boolean, "click-to-exit", { .snum = &config.click_to_exit }, NULL,
"Click outside the window to exit", CONFIG_DEFAULT },
{ xrm_Boolean, "show-match", { .snum = &config.show_match }, NULL,
"Indicate how it match by underlining it.", CONFIG_DEFAULT },
};
/** Dynamic array of extra options */