From eacb7c80619dd0c2d8bf601215374f64779373b6 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sat, 25 Jun 2022 11:28:23 +0100 Subject: Fix padding and split into top/bottom/left/right. --- src/main.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index cf0e3a8..d02a109 100644 --- a/src/main.c +++ b/src/main.c @@ -568,13 +568,11 @@ static void usage() " --outline-color Color of the border outlines.\n" " --border-width Width of the border.\n" " --border-color Color of the border.\n" -" --entry-padding Padding around the entry box.\n" -" --entry-color Color of the entry box.\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-padding Spacing between results. Can be negative.\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" @@ -583,6 +581,10 @@ static void usage() " --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" @@ -598,8 +600,6 @@ static void parse_args(struct tofi *tofi, int argc, char *argv[]) {"anchor", required_argument, NULL, 0}, {"background-color", required_argument, NULL, 0}, {"corner-radius", required_argument, NULL, 0}, - {"entry-padding", required_argument, NULL, 0}, - {"entry-color", required_argument, NULL, 0}, {"font-name", required_argument, NULL, 0}, {"font-size", required_argument, NULL, 0}, {"num-results", required_argument, NULL, 0}, @@ -607,7 +607,7 @@ static void parse_args(struct tofi *tofi, int argc, char *argv[]) {"outline-width", required_argument, NULL, 0}, {"outline-color", required_argument, NULL, 0}, {"prompt-text", required_argument, NULL, 0}, - {"result-padding", required_argument, NULL, 0}, + {"result-spacing", required_argument, NULL, 0}, {"min-input-width", required_argument, NULL, 0}, {"border-width", required_argument, NULL, 0}, {"border-color", required_argument, NULL, 0}, @@ -618,6 +618,10 @@ static void parse_args(struct tofi *tofi, int argc, char *argv[]) {"margin-bottom", required_argument, NULL, 0}, {"margin-left", required_argument, NULL, 0}, {"margin-right", required_argument, NULL, 0}, + {"padding-top", required_argument, NULL, 0}, + {"padding-bottom", required_argument, NULL, 0}, + {"padding-left", required_argument, NULL, 0}, + {"padding-right", required_argument, NULL, 0}, {"horizontal", required_argument, NULL, 0}, {"hide-cursor", required_argument, NULL, 0}, {"history", required_argument, NULL, 0}, @@ -693,20 +697,21 @@ int main(int argc, char *argv[]) .width = 1280, .height = 720, .entry = { - .border = { - .width = 12, - .outline_width = 4, - .color = {0.976f, 0.149f, 0.447f, 1.0f}, - .outline_color = {0.031f, 0.031f, 0.0f, 1.0f}, - }, .font_name = "Sans", .font_size = 24, .prompt_text = "run: ", .num_results = 5, - .padding = 8, + .padding_top = 8, + .padding_bottom = 8, + .padding_left = 8, + .padding_right = 8, + .border_width = 12, + .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_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}, } }, .anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP -- cgit v1.2.3