summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--doc/ratpoison.texi3
-rw-r--r--src/actions.c24
-rw-r--r--src/actions.h1
-rw-r--r--src/input.c4
5 files changed, 37 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b845c74..64ddbda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2001-12-21 shawn <sabetts@vcn.bc.ca>
+ * src/input.c (update_input_window): Draw the cursor in the right place.
+
+ * src/actions.h (cmd_defbarpadding): new prototype
+
+ * src/actions.c (user_commands): new command entry "defbarpadding"
+ (cmd_defbarpadding): new function
+
* src/data.h (rp_error_msg): new global extern
* src/main.c (rp_error_msg): new global variable
diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi
index 94c8dac..3e0d75e 100644
--- a/doc/ratpoison.texi
+++ b/doc/ratpoison.texi
@@ -371,6 +371,9 @@ Set the message bar location. @var{n} is a value between 0 and 3. 0 is
the top left and the values move clockwise around the screen to the
bottom left which is 3.
+@item defbarpadding @var{x} @var{y}
+Set the horizontal and vertical padding inside the bar.
+
@item msgwait @var{n}
Set the bar's timeout in seconds.
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);
}