From bcff7094627e423dd9ca52a246345512dc3d791c Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sun, 26 Jun 2022 23:44:28 +0100 Subject: Add optional background around selected result. --- src/main.c | 73 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 35 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index d6f6d88..362fef6 100644 --- a/src/main.c +++ b/src/main.c @@ -592,40 +592,42 @@ static void usage() fprintf(stderr, "%s", "Usage: tofi [options]\n" "\n" -" -h, --help Print this message and exit.\n" -" -c, --config Specify a config file.\n" -" --font Font to use.\n" -" --font-size Point size of text.\n" -" --background-color Color of the background.\n" -" --outline-width Width of the border outlines.\n" -" --outline-color Color of the border outlines.\n" -" --border-width Width of the border.\n" -" --border-color Color of the border.\n" -" --text-color Color of text.\n" -" --prompt-text Prompt text.\n" -" --num-results Maximum number of results to display.\n" -" --selection-color Color of selected result.\n" -" --result-spacing Spacing between results. Can be negative.\n" -" --min-input-width Minimum width of input in horizontal mode.\n" -" --width Width of the window.\n" -" --height Height of the window.\n" -" --corner-radius Radius of window corners.\n" -" --output Name of output to display window on.\n" -" --anchor Location on screen to anchor window.\n" -" --margin-top Offset from top of screen.\n" -" --margin-bottom Offset from bottom of screen.\n" -" --margin-left Offset from left of screen.\n" -" --margin-right Offset from right of screen.\n" -" --padding-top Padding between top border and text.\n" -" --padding-bottom Padding between bottom border and text.\n" -" --padding-left Padding between left border and text.\n" -" --padding-right Padding between right border and text.\n" -" --hide-cursor Hide the cursor.\n" -" --horizontal List results horizontally.\n" -" --history Sort results by number of usages.\n" -" --hint-font Perform font hinting.\n" -" --late-keyboard-init (EXPERIMENTAL) Delay keyboard initialisation\n" -" until after the first draw to screen.\n" +" -h, --help Print this message and exit.\n" +" -c, --config Specify a config file.\n" +" --font Font to use.\n" +" --font-size Point size of text.\n" +" --background-color Color of the background.\n" +" --outline-width Width of the border outlines.\n" +" --outline-color Color of the border outlines.\n" +" --border-width Width of the border.\n" +" --border-color Color of the border.\n" +" --text-color Color of text.\n" +" --prompt-text Prompt text.\n" +" --num-results Maximum number of results to display.\n" +" --selection-color Color of selected result.\n" +" --selection-background Color of selected result background.\n" +" --result-spacing Spacing between results.\n" +" --min-input-width Minimum input width in horizontal mode.\n" +" --width Width of the window.\n" +" --height Height of the window.\n" +" --corner-radius Radius of window corners.\n" +" --output Name of output to display window on.\n" +" --anchor Location on screen to anchor window.\n" +" --margin-top Offset from top of screen.\n" +" --margin-bottom Offset from bottom of screen.\n" +" --margin-left Offset from left of screen.\n" +" --margin-right Offset from right of screen.\n" +" --padding-top Padding between top border and text.\n" +" --padding-bottom Padding between bottom border and text.\n" +" --padding-left Padding between left border and text.\n" +" --padding-right Padding between right border and text.\n" +" --hide-cursor Hide the cursor.\n" +" --horizontal List results horizontally.\n" +" --history Sort results by number of usages.\n" +" --hint-font Perform font hinting.\n" +" --late-keyboard-init (EXPERIMENTAL) Delay keyboard\n" +" initialisation until after the first\n" +" draw to screen.\n" ); } @@ -640,6 +642,7 @@ const struct option long_options[] = { {"font-size", required_argument, NULL, 0}, {"num-results", required_argument, NULL, 0}, {"selection-color", required_argument, NULL, 0}, + {"selection-background", required_argument, NULL, 0}, {"outline-width", required_argument, NULL, 0}, {"outline-color", required_argument, NULL, 0}, {"prompt-text", required_argument, NULL, 0}, @@ -771,7 +774,7 @@ int main(int argc, char *argv[]) .outline_width = 4, .background_color = {0.106f, 0.114f, 0.118f, 1.0f}, .foreground_color = {1.0f, 1.0f, 1.0f, 1.0f}, - .selection_color = {0.976f, 0.149f, 0.447f, 1.0f}, + .selection_foreground_color = {0.976f, 0.149f, 0.447f, 1.0f}, .border_color = {0.976f, 0.149f, 0.447f, 1.0f}, .outline_color = {0.031f, 0.031f, 0.0f, 1.0f}, } -- cgit v1.2.3