diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/actions.c | 24 | ||||
-rw-r--r-- | src/actions.h | 1 | ||||
-rw-r--r-- | src/input.c | 4 |
3 files changed, 27 insertions, 2 deletions
diff --git a/src/actions.c b/src/actions.c index acc6398..48e9179 100644 --- a/src/actions.c +++ b/src/actions.c @@ -97,6 +97,7 @@ static user_command user_commands[] = {"defwingravity", cmd_defwingravity, arg_STRING}, {"deffgcolor", cmd_deffgcolor, arg_STRING}, {"defbgcolor", cmd_defbgcolor, arg_STRING}, + {"defbarpadding", cmd_defbarpadding, arg_STRING}, /* Commands to help debug ratpoison. */ #ifdef DEBUG @@ -2040,3 +2041,26 @@ cmd_link (int interactive, void *data) return NULL; } + +char * +cmd_defbarpadding (int interactive, void *data) +{ + int x, y; + + if (data == NULL || sscanf (data, "%d %d", &x, &y) < 2) + { + message (" defbarpadding: Two arguments required "); + return NULL; + } + + if (x >= 0 && y >= 0) + { + defaults.bar_x_padding = x; + defaults.bar_y_padding = y; + } + else + { + message (" defbarpadding: Bad argument "); + } + return NULL; +} diff --git a/src/actions.h b/src/actions.h index 0e6fb56..f285e4f 100644 --- a/src/actions.h +++ b/src/actions.h @@ -104,6 +104,7 @@ char * cmd_restart (int interactive, void *data); char * cmd_startup_message (int interactive, void *data); char * cmd_focuslast (int interactive, void *data); char * cmd_link (int interactive, void *data); +char * cmd_defbarpadding (int interactive, void *data); /* void cmd_xterm (void *data); */ diff --git a/src/input.c b/src/input.c index 9c6c14b..27d7583 100644 --- a/src/input.c +++ b/src/input.c @@ -295,9 +295,9 @@ update_input_window (screen_info *s, char *prompt, char *input, int input_len) /* Draw a cheap-o cursor. */ XDrawLine (dpy, s->input_window, s->normal_gc, - defaults.bar_x_padding * 2 + prompt_width + input_width + 2, + defaults.bar_x_padding + prompt_width + input_width + 2, defaults.bar_y_padding + 1, - defaults.bar_x_padding * 2 + prompt_width + input_width + 2, + defaults.bar_x_padding + prompt_width + input_width + 2, defaults.bar_y_padding + FONT_HEIGHT (defaults.font) - 1); } |