summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2002-01-24 21:57:44 +0000
committersabetts <sabetts>2002-01-24 21:57:44 +0000
commit61432f3c09711bf6690af0d851a5fda92c009153 (patch)
treee5e2f378a8f6d19ebdb78ed7c15701c784495899 /src/actions.c
parent66ef30a4b79636b748107e00be805d1885a88af8 (diff)
downloadratpoison-61432f3c09711bf6690af0d851a5fda92c009153.zip
* src/messages.h (MESSAGE_FRAME_STRING): Pad the string with
spaces on both sides. * src/main.c (init_screen): Create the frame, input, and bar windows with a border width of defaults.bar_border_width. (init_defaults): initialize defaults.bar_border_width * src/bar.c (bar_x): Incorporate defaults.bar_border_width into calculations. (bar_y): likewise * src/actions.h (cmd_defbarborder): new prototype * src/actions.c (user_commands): new command "defbarborder" (cmd_defbarborder): new function * src/main.c (init_screen): create the help window with a 0 border width.
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/actions.c b/src/actions.c
index c62faef..b790557 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -92,6 +92,7 @@ static user_command user_commands[] =
{"definputwidth", cmd_definputwidth, arg_STRING},
{"defmaxsizegravity", cmd_defmaxsizegravity, arg_STRING},
{"defpadding", cmd_defpadding, arg_STRING},
+ {"defbarborder", cmd_defbarborder, arg_STRING},
{"deftransgravity", cmd_deftransgravity, arg_STRING},
{"defwaitcursor", cmd_defwaitcursor, arg_STRING},
{"defwinfmt", cmd_defwinfmt, arg_STRING},
@@ -1885,6 +1886,41 @@ cmd_defborder (int interactive, void *data)
}
char *
+cmd_defbarborder (int interactive, void *data)
+{
+ int tmp;
+ int i;
+
+ if (data == NULL && !interactive)
+ return xsprintf ("%d", defaults.window_border_width);
+
+ if (data == NULL
+ || sscanf (data, "%d", &tmp) < 1)
+ {
+ message (" defbarborder: One argument required ");
+ return NULL;
+ }
+
+ if (tmp >= 0)
+ defaults.bar_border_width = tmp;
+ else
+ {
+ message (" defbarborder: Bad argument ");
+ return NULL;
+ }
+
+ /* Update the frame and bar windows. */
+ for (i=0; i<num_screens; i++)
+ {
+ XSetWindowBorderWidth (dpy, screens[i].bar_window, defaults.bar_border_width);
+ XSetWindowBorderWidth (dpy, screens[i].frame_window, defaults.bar_border_width);
+ XSetWindowBorderWidth (dpy, screens[i].input_window, defaults.bar_border_width);
+ }
+
+ return NULL;
+}
+
+char *
cmd_definputwidth (int interactive, void *data)
{
if (data == NULL && !interactive)