From 358f741058879d91b501df1d8eb336df6897c55a Mon Sep 17 00:00:00 2001 From: sabetts Date: Thu, 24 Jan 2002 22:17:50 +0000 Subject: * src/actions.c (cmd_defbarloc): Read the location argument as a gravity argument using parse_wingravity. --- src/actions.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index b790557..db73111 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1702,30 +1702,29 @@ cmd_defbarloc (int interactive, void *data) if (data == NULL && !interactive) return xstrdup (wingravity_to_string (defaults.bar_location)); - if (data == NULL - || sscanf (data, "%d", &loc) < 1) + if (data == NULL) { message (" defbarloc: One argument required "); return NULL; } + if ((loc = parse_wingravity (data)) < 0) + { + message (" defbarloc: Bad location "); + return NULL; + } + switch (loc) { - case 0: - defaults.bar_location = NorthWestGravity; - break; - case 1: - defaults.bar_location = NorthEastGravity; - break; - case 2: - defaults.bar_location = SouthEastGravity; - break; - case 3: - defaults.bar_location = SouthWestGravity; + case NorthWestGravity: + case NorthEastGravity: + case SouthWestGravity: + case SouthEastGravity: + defaults.bar_location = loc; break; default: - message (" defbarloc: Unknown location "); + message (" defbarloc: Bad location "); break; } @@ -1892,7 +1891,7 @@ cmd_defbarborder (int interactive, void *data) int i; if (data == NULL && !interactive) - return xsprintf ("%d", defaults.window_border_width); + return xsprintf ("%d", defaults.bar_border_width); if (data == NULL || sscanf (data, "%d", &tmp) < 1) -- cgit v1.2.3